pub struct CollectionSnapshot { /* private fields */ }Expand description
An immutable, lock-free-readable view of a single-vector collection (ADR-0064):
the base index as of the last rebuild, the base id map, and the overlay of
writes since. Obtained via Database::collection_snapshot and read with
CollectionSnapshot::search; a read is snapshot-isolated — it sees one
consistent (base, overlay) pair, and a write that lands mid-read is simply
the next snapshot.
Implementations§
Source§impl CollectionSnapshot
impl CollectionSnapshot
Sourcepub fn search(
&self,
query: &[f32],
k: usize,
ef_search: usize,
) -> Result<Vec<Match>>
pub fn search( &self, query: &[f32], k: usize, ef_search: usize, ) -> Result<Vec<Match>>
Lock-free nearest-neighbor search over the base index merged with the
overlay (ADR-0064 increment 1) — pure vector reads: no payload filter
and no payload/vector fetch (those need the store and land in increment 2).
Returns the k nearest live points, closest first, scored in the true
collection metric — identical ordering and scores to the locked
Database::search_snapshot path for the same case.
§Errors
Propagates an index search error.