pub struct IndexConfig {
pub nbits: usize,
pub batch_size: usize,
pub seed: Option<u64>,
pub kmeans_niters: usize,
pub max_points_per_centroid: usize,
pub n_samples_kmeans: Option<usize>,
pub start_from_scratch: usize,
}Expand description
Configuration for index creation
Fields§
§nbits: usizeNumber of bits for quantization (typically 2 or 4)
batch_size: usizeBatch size for processing
seed: Option<u64>Random seed for reproducibility
kmeans_niters: usizeNumber of K-means iterations (default: 4)
max_points_per_centroid: usizeMaximum number of points per centroid for K-means (default: 256)
n_samples_kmeans: Option<usize>Number of samples for K-means training. If None, uses heuristic: min(1 + 16 * sqrt(120 * num_documents), num_documents)
start_from_scratch: usizeThreshold for start-from-scratch mode (default: 999). When the number of documents is <= this threshold, raw embeddings are saved to embeddings.npy for potential rebuilds during updates.
Trait Implementations§
Source§impl Clone for IndexConfig
impl Clone for IndexConfig
Source§fn clone(&self) -> IndexConfig
fn clone(&self) -> IndexConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IndexConfig
impl Debug for IndexConfig
Source§impl Default for IndexConfig
impl Default for IndexConfig
Source§impl<'de> Deserialize<'de> for IndexConfig
impl<'de> Deserialize<'de> for IndexConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for IndexConfig
impl RefUnwindSafe for IndexConfig
impl Send for IndexConfig
impl Sync for IndexConfig
impl Unpin for IndexConfig
impl UnwindSafe for IndexConfig
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
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>
Converts
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>
Converts
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 more