Skip to main content

IndexParams

Struct IndexParams 

Source
pub struct IndexParams { /* private fields */ }
Expand description

Parameters for configuring an index on a field.

Implementations§

Source§

impl IndexParams

Source

pub unsafe fn as_raw(&self) -> *mut zvec_index_params_t

Returns the raw FFI handle.

§Safety

The caller must not use the handle after the IndexParams is dropped.

Source

pub fn hnsw(metric: MetricType, m: i32, ef_construction: i32) -> Result<Self>

Creates HNSW index parameters.

Source

pub fn hnsw_with_quantize( metric: MetricType, m: i32, ef_construction: i32, quantize: QuantizeType, ) -> Result<Self>

Creates HNSW index parameters with quantization.

Source

pub fn ivf( metric: MetricType, n_list: i32, n_iters: i32, use_soar: bool, ) -> Result<Self>

Creates IVF index parameters.

Source

pub fn flat(metric: MetricType) -> Result<Self>

Creates Flat index parameters.

Source

pub fn invert(enable_range_opt: bool, enable_wildcard: bool) -> Result<Self>

Creates inverted index parameters for scalar fields.

Source

pub fn fts( tokenizer_name: Option<&str>, filters: Option<&[&str]>, extra_params: Option<&str>, ) -> Result<Self>

Creates FTS (Full-Text Search) index parameters.

All parameters are optional — passing None keeps the library default.

Source

pub fn index_type(&self) -> IndexType

Returns the index type.

Source

pub fn metric_type(&self) -> MetricType

Returns the metric type.

Source

pub fn quantize_type(&self) -> QuantizeType

Returns the quantize type.

Source

pub fn set_metric_type(&mut self, metric: MetricType) -> Result<()>

Sets the metric type.

Source

pub fn set_quantize_type(&mut self, quantize: QuantizeType) -> Result<()>

Sets the quantize type.

Trait Implementations§

Source§

impl Drop for IndexParams

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.