[−][src]Struct ngt::Index
Implementations
impl Index
[src]
pub fn create<P: AsRef<Path>>(path: P, prop: Properties) -> Result<Self, Error>
[src]
Create an empty index with the given properies.
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
[src]
Open the already existing index at the specified path.
pub fn search(
&self,
vec: &[f64],
res_size: u64,
epsilon: f32
) -> Result<Vec<SearchResult>, Error>
[src]
&self,
vec: &[f64],
res_size: u64,
epsilon: f32
) -> Result<Vec<SearchResult>, Error>
Search the nearest vectors to the specified query vector. The index must have been built beforehand.
pub fn insert<F: Into<f64>>(&mut self, vec: Vec<F>) -> Result<VecId, Error>
[src]
Insert the specified vector into the index. However note that it is not discoverable yet. The method build must be called after inserting vectors.
pub fn insert_batch<F: Into<f64>>(
&mut self,
batch: Vec<Vec<F>>
) -> Result<(), Error>
[src]
&mut self,
batch: Vec<Vec<F>>
) -> Result<(), Error>
Insert the multiple vectors into the index. However note that they are not discoverable yet. The method build must be called after inserting vectors.
pub fn build(&mut self, num_threads: u32) -> Result<(), Error>
[src]
Build the index for the vectors that have been inserted so far.
pub fn persist(&mut self) -> Result<(), Error>
[src]
Persist the index to the disk.
pub fn remove(&mut self, id: VecId) -> Result<(), Error>
[src]
Remove the specified vector.
pub fn get_vec(&self, id: VecId) -> Result<Vec<f32>, Error>
[src]
Get the specified vector.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,