pub struct IndexParams { /* private fields */ }Expand description
Parameters for configuring an index on a field.
Implementations§
Source§impl IndexParams
impl IndexParams
Sourcepub unsafe fn as_raw(&self) -> *mut zvec_index_params_t
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.
Sourcepub fn hnsw(metric: MetricType, m: i32, ef_construction: i32) -> Result<Self>
pub fn hnsw(metric: MetricType, m: i32, ef_construction: i32) -> Result<Self>
Creates HNSW index parameters.
Sourcepub fn hnsw_with_quantize(
metric: MetricType,
m: i32,
ef_construction: i32,
quantize: QuantizeType,
) -> Result<Self>
pub fn hnsw_with_quantize( metric: MetricType, m: i32, ef_construction: i32, quantize: QuantizeType, ) -> Result<Self>
Creates HNSW index parameters with quantization.
Sourcepub fn ivf(
metric: MetricType,
n_list: i32,
n_iters: i32,
use_soar: bool,
) -> Result<Self>
pub fn ivf( metric: MetricType, n_list: i32, n_iters: i32, use_soar: bool, ) -> Result<Self>
Creates IVF index parameters.
Sourcepub fn flat(metric: MetricType) -> Result<Self>
pub fn flat(metric: MetricType) -> Result<Self>
Creates Flat index parameters.
Sourcepub fn invert(enable_range_opt: bool, enable_wildcard: bool) -> Result<Self>
pub fn invert(enable_range_opt: bool, enable_wildcard: bool) -> Result<Self>
Creates inverted index parameters for scalar fields.
Sourcepub fn fts(
tokenizer_name: Option<&str>,
filters: Option<&[&str]>,
extra_params: Option<&str>,
) -> Result<Self>
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.
Sourcepub fn index_type(&self) -> IndexType
pub fn index_type(&self) -> IndexType
Returns the index type.
Sourcepub fn metric_type(&self) -> MetricType
pub fn metric_type(&self) -> MetricType
Returns the metric type.
Sourcepub fn quantize_type(&self) -> QuantizeType
pub fn quantize_type(&self) -> QuantizeType
Returns the quantize type.
Sourcepub fn set_metric_type(&mut self, metric: MetricType) -> Result<()>
pub fn set_metric_type(&mut self, metric: MetricType) -> Result<()>
Sets the metric type.
Sourcepub fn set_quantize_type(&mut self, quantize: QuantizeType) -> Result<()>
pub fn set_quantize_type(&mut self, quantize: QuantizeType) -> Result<()>
Sets the quantize type.
Trait Implementations§
Source§impl Drop for IndexParams
impl Drop for IndexParams
Auto Trait Implementations§
impl !Send for IndexParams
impl !Sync for IndexParams
impl Freeze for IndexParams
impl RefUnwindSafe for IndexParams
impl Unpin for IndexParams
impl UnsafeUnpin for IndexParams
impl UnwindSafe for IndexParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more