pub struct DenseVectorConfig {
pub dim: usize,
pub index_type: VectorIndexType,
pub store_raw: bool,
pub coarse_centroids_path: Option<String>,
pub pq_codebook_path: Option<String>,
pub nprobe: usize,
pub mrl_dim: Option<usize>,
}Expand description
Configuration for dense vector fields using RaBitQ, IVF-RaBitQ, or ScaNN
Fields§
§dim: usizeDimensionality of vectors
index_type: VectorIndexTypeVector index algorithm to use
store_raw: boolWhether to store raw vectors for re-ranking (increases storage but improves accuracy)
coarse_centroids_path: Option<String>Path to pre-trained coarse centroids file for IVF indexes Required for IVF-RaBitQ and ScaNN
pq_codebook_path: Option<String>Path to pre-trained PQ codebook file for ScaNN
nprobe: usizeNumber of clusters to probe during search (default: 32)
mrl_dim: Option<usize>Matryoshka/MRL dimension for index - use only first mrl_dim coordinates for indexing Full vectors are stored but index uses truncated vectors for faster search Must be <= dim. If None, uses full dim.
Implementations§
Source§impl DenseVectorConfig
impl DenseVectorConfig
pub fn new(dim: usize) -> Self
pub fn with_ivf(dim: usize, centroids_path: String, nprobe: usize) -> Self
Sourcepub fn with_scann(
dim: usize,
centroids_path: String,
codebook_path: String,
nprobe: usize,
) -> Self
pub fn with_scann( dim: usize, centroids_path: String, codebook_path: String, nprobe: usize, ) -> Self
Create ScaNN configuration with pre-trained centroids and codebook
pub fn without_raw(dim: usize) -> Self
Sourcepub fn with_mrl_dim(self, mrl_dim: usize) -> Self
pub fn with_mrl_dim(self, mrl_dim: usize) -> Self
Set matryoshka/MRL dimension for index truncation
Sourcepub fn index_dim(&self) -> usize
pub fn index_dim(&self) -> usize
Get the effective dimension for indexing (mrl_dim if set, otherwise dim)
Sourcepub fn uses_scann(&self) -> bool
pub fn uses_scann(&self) -> bool
Check if this config uses ScaNN
Trait Implementations§
Source§impl Clone for DenseVectorConfig
impl Clone for DenseVectorConfig
Source§fn clone(&self) -> DenseVectorConfig
fn clone(&self) -> DenseVectorConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DenseVectorConfig
impl Debug for DenseVectorConfig
Source§impl<'de> Deserialize<'de> for DenseVectorConfig
impl<'de> Deserialize<'de> for DenseVectorConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for DenseVectorConfig
impl RefUnwindSafe for DenseVectorConfig
impl Send for DenseVectorConfig
impl Sync for DenseVectorConfig
impl Unpin for DenseVectorConfig
impl UnwindSafe for DenseVectorConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.