pub struct MultiVectorIndex { /* private fields */ }Implementations§
Source§impl MultiVectorIndex
impl MultiVectorIndex
pub fn retrieve( &self, request: &RetrieveRequest, ) -> Result<RetrievalResponse, IndexError>
Source§impl MultiVectorIndex
impl MultiVectorIndex
pub fn open_existing( path: impl AsRef<Path>, durability: Durability, ) -> Result<Self, IndexError>
pub fn open( path: impl AsRef<Path>, config: IndexConfig, ) -> Result<Self, IndexError>
pub fn open_with_durability( path: impl AsRef<Path>, config: IndexConfig, durability: Durability, ) -> Result<Self, IndexError>
Sourcepub fn train(
&self,
samples: &[Vec<f32>],
iterations: usize,
) -> Result<(), IndexError>
pub fn train( &self, samples: &[Vec<f32>], iterations: usize, ) -> Result<(), IndexError>
Train PLAID’s coarse k-means codebook. Must happen before ingestion.
pub fn upsert( &self, id: impl Into<String>, vectors: Vec<Vec<f32>>, metadata: Value, ) -> Result<(), IndexError>
Sourcepub fn upsert_batch(&self, batch: Vec<UpsertDocument>) -> Result<(), IndexError>
pub fn upsert_batch(&self, batch: Vec<UpsertDocument>) -> Result<(), IndexError>
Atomically replace the whole batch. Duplicate IDs use the last value. Empty batches are no-ops. On a pre-publication error no document, posting, generation, or existing ANN changes; unreachable bytes may remain in the append-only segments until recovery/compaction.
pub fn upsert_records( &self, batch: Vec<RetrievalDocument>, ) -> Result<(), IndexError>
pub fn delete(&self, id: &str) -> Result<bool, IndexError>
Sourcepub fn query(
&self,
vectors: &[Vec<f32>],
top_k: usize,
candidates: Option<usize>,
) -> Result<Vec<Hit>, IndexError>
pub fn query( &self, vectors: &[Vec<f32>], top_k: usize, candidates: Option<usize>, ) -> Result<Vec<Hit>, IndexError>
Exact MUVERA candidates followed by compressed MaxSim rescoring.
Sourcepub fn hnsw_ready(&self) -> bool
pub fn hnsw_ready(&self) -> bool
Whether the base plus mutable overlay covers the current generation.
Sourcepub fn query_auto(
&self,
vectors: &[Vec<f32>],
top_k: usize,
candidates: Option<usize>,
ef_search: usize,
) -> Result<Vec<Hit>, IndexError>
pub fn query_auto( &self, vectors: &[Vec<f32>], top_k: usize, candidates: Option<usize>, ef_search: usize, ) -> Result<Vec<Hit>, IndexError>
Use a fresh FDE-HNSW base plus exact delta when available; otherwise use exact FDE. Selection and rescoring share one generation read guard.
Sourcepub fn query_auto_with_backend(
&self,
vectors: &[Vec<f32>],
top_k: usize,
candidates: Option<usize>,
ef_search: usize,
) -> Result<(Vec<Hit>, &'static str), IndexError>
pub fn query_auto_with_backend( &self, vectors: &[Vec<f32>], top_k: usize, candidates: Option<usize>, ef_search: usize, ) -> Result<(Vec<Hit>, &'static str), IndexError>
Return the actual backend used under the same snapshot as the results.
Sourcepub fn query_with_centroid_pruning(
&self,
vectors: &[Vec<f32>],
top_k: usize,
candidates: usize,
rerank_candidates: usize,
) -> Result<Vec<Hit>, IndexError>
pub fn query_with_centroid_pruning( &self, vectors: &[Vec<f32>], top_k: usize, candidates: usize, rerank_candidates: usize, ) -> Result<Vec<Hit>, IndexError>
Generate broad FDE candidates, prune with centroid-only MaxSim, then decode residuals only for the surviving documents.
Sourcepub fn query_with_fde_ann_and_pruning(
&self,
vectors: &[Vec<f32>],
top_k: usize,
candidates: usize,
rerank_candidates: usize,
ef_search: usize,
) -> Result<Vec<Hit>, IndexError>
pub fn query_with_fde_ann_and_pruning( &self, vectors: &[Vec<f32>], top_k: usize, candidates: usize, rerank_candidates: usize, ef_search: usize, ) -> Result<Vec<Hit>, IndexError>
Same pipeline as query_with_centroid_pruning, but pulls the broad
candidate set from the FDE HNSW graph instead of the exact FDE scan.
Sourcepub fn exact_fde_candidates(
&self,
vectors: &[Vec<f32>],
count: usize,
) -> Result<Vec<CandidateHit>, IndexError>
pub fn exact_fde_candidates( &self, vectors: &[Vec<f32>], count: usize, ) -> Result<Vec<CandidateHit>, IndexError>
Return exact FDE candidates before compressed MaxSim reranking.
Sourcepub fn build_fde_ann(
&self,
m: usize,
ef_construct: usize,
) -> Result<usize, IndexError>
pub fn build_fde_ann( &self, m: usize, ef_construct: usize, ) -> Result<usize, IndexError>
Build an HNSW index over persisted FDEs. Exact FDE scan remains available as an oracle.
pub fn build_dense_ann( &self, field: &str, m: usize, ef_construct: usize, ) -> Result<usize, IndexError>
pub fn query_with_fde_ann( &self, vectors: &[Vec<f32>], top_k: usize, candidates: Option<usize>, ef_search: usize, ) -> Result<Vec<Hit>, IndexError>
Sourcepub fn ann_fde_candidates(
&self,
vectors: &[Vec<f32>],
count: usize,
ef_search: usize,
) -> Result<Vec<CandidateHit>, IndexError>
pub fn ann_fde_candidates( &self, vectors: &[Vec<f32>], count: usize, ef_search: usize, ) -> Result<Vec<CandidateHit>, IndexError>
Return HNSW FDE candidates before compressed MaxSim reranking.
pub fn query_with_probes( &self, vectors: &[Vec<f32>], top_k: usize, candidates: Option<usize>, probes: usize, ) -> Result<Vec<Hit>, IndexError>
pub fn seal(&self) -> Result<(), IndexError>
Sourcepub fn compact(&self) -> Result<Value, IndexError>
pub fn compact(&self) -> Result<Value, IndexError>
Copy live records into a new append segment and atomically publish its locations. Existing readers retain their old files until they finish.
pub fn stats(&self) -> IndexStats
Sourcepub fn score_uncompressed(
&self,
query: &[Vec<f32>],
document: &[Vec<f32>],
) -> Result<f32, IndexError>
pub fn score_uncompressed( &self, query: &[Vec<f32>], document: &[Vec<f32>], ) -> Result<f32, IndexError>
Diagnostic score over caller-provided vectors; used to verify scorer parity.
Sourcepub fn score_compressed(
&self,
query: &[Vec<f32>],
id: &str,
) -> Result<f32, IndexError>
pub fn score_compressed( &self, query: &[Vec<f32>], id: &str, ) -> Result<f32, IndexError>
Diagnostic score over the actual compressed bytes stored for a document.
Auto Trait Implementations§
impl !Freeze for MultiVectorIndex
impl RefUnwindSafe for MultiVectorIndex
impl Send for MultiVectorIndex
impl Sync for MultiVectorIndex
impl Unpin for MultiVectorIndex
impl UnsafeUnpin for MultiVectorIndex
impl UnwindSafe for MultiVectorIndex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more