attribute_search_engine

Trait SearchIndex

Source
pub trait SearchIndex<P> {
    // Required method
    fn search(&self, query: &Query) -> Result<HashSet<P>>;
}
Expand description

This trait describes the minimum features an Index must support to be usable as a SearchIndex, for example in a SearchEngine.

Required Methods§

Source

fn search(&self, query: &Query) -> Result<HashSet<P>>

Perform a search on an index.

This function returns an HashSet of all matching results. It may not accept all enum values of Query but only a small subset. If a Query is not supported, this function returns UnsupportedQuery.

If the strings in the Query cannot be parsed to the expected payload type, this function returns MismatchedQueryType.

Implementors§

Source§

impl<P, V> SearchIndex<P> for SearchIndexBTreeRange<P, V>
where P: Eq + Hash + Clone + 'static, V: Ord + FromStr + 'static,

Source§

impl<P: Clone, V: Eq + Hash + FromStr> SearchIndex<P> for SearchIndexHashMap<P, V>

Source§

impl<P: Eq + Hash + Clone> SearchIndex<P> for SearchIndexPrefixTree<P>