pub trait ConcurrentIndex: Index {
    fn assign(&self, q: &[f32], k: usize) -> Result<AssignSearchResult>;
    fn search(&self, q: &[f32], k: usize) -> Result<SearchResult>;
    fn range_search(&self, q: &[f32], radius: f32) -> Result<RangeSearchResult>;
}
Expand description

Trait for a Faiss index that can be safely searched over multiple threads. Operations which do not modify the index are given a method taking an immutable reference. This is not the default for every index type because some implementations (such as the ones running on the GPU) do not allow concurrent searches.

Users of these methods should still note that batched querying is considerably faster than running queries one by one, even in parallel.

Required Methods§

Similar to search, but only provides the labels.

Perform a search for the k closest vectors to the given query vectors.

Perform a ranged search for the vectors closest to the given query vectors by the given radius.

Implementors§