Type Alias faiss::index::flat::FlatIndex

source ·
pub type FlatIndex = FlatIndexImpl;
Expand description

Alias for the native implementation of a flat index.

Trait Implementations§

source§

impl Index for FlatIndex

source§

fn is_trained(&self) -> bool

Whether the Index does not require training, or if training is done already
source§

fn ntotal(&self) -> u64

The total number of vectors indexed
source§

fn d(&self) -> u32

The dimensionality of the indexed vectors
source§

fn metric_type(&self) -> MetricType

The metric type assumed by the index
source§

fn add(&mut self, x: &[f32]) -> Result<()>

Add new data vectors to the index. This assumes a C-contiguous memory slice of vectors, where the total number of vectors is x.len() / d.
source§

fn add_with_ids(&mut self, x: &[f32], xids: &[Idx]) -> Result<()>

Add new data vectors to the index with IDs. This assumes a C-contiguous memory slice of vectors, where the total number of vectors is x.len() / d. Not all index types may support this operation.
source§

fn train(&mut self, x: &[f32]) -> Result<()>

Train the underlying index with the given data.
source§

fn assign(&mut self, query: &[f32], k: usize) -> Result<AssignSearchResult>

Similar to search, but only provides the labels.
source§

fn search(&mut self, query: &[f32], k: usize) -> Result<SearchResult>

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.
source§

fn reset(&mut self) -> Result<()>

Clear the entire index.
source§

fn remove_ids(&mut self, sel: &IdSelector) -> Result<usize>

Remove data vectors represented by IDs.
source§

fn verbose(&self) -> bool

Index verbosity level
source§

fn set_verbose(&mut self, value: bool)

Set Index verbosity level