Skip to main content

DiskANNQuery

Struct DiskANNQuery 

Source
pub struct DiskANNQuery<'a> { /* private fields */ }
Expand description

A reusable prepared generation on one fixed canonical/catalog view. Opening verifies resident PQ and complete origins once; later queries reuse those owners and load graph pages lazily. Execution owns logical read observations before invoking this storage algorithm.

Implementations§

Source§

impl<'a> DiskANNQuery<'a>

Source

pub fn open( canonical: &'a dyn DiskANNQueryRead, source: Arc<dyn DiskANNPageSource>, parameters: DiskANNIndexParams, limits: DiskANNReadLimits, control: &StorageReadControl, ) -> StorageBackendResult<Self>

Open the physical source selected by the caller’s actual retained catalog/canonical view. Provider query adapters perform that binding; matching a caller-supplied generation label alone does not establish it. All failures propagate without an exact-scan fallback.

Source

pub fn search_knn( &self, query: &[f32], k: usize, control: &StorageReadControl, ) -> StorageBackendResult<DiskANNQueryResult>

Approximate document top-k after complete tensor reranking, exact uncovered changes and numeric side entries. Exhausted ANN support continues through unexpanded nodes until the document quota is met or the entire base is exhausted.

Source

pub fn search_threshold( &self, query: &[f32], threshold: f32, control: &StorageReadControl, ) -> StorageBackendResult<PostingList>

Exact threshold evaluation streams all visible canonical tensors, including changes and empty replacements, independently of ANN membership.

Source

pub fn search_threshold_with_stats( &self, query: &[f32], threshold: f32, control: &StorageReadControl, ) -> StorageBackendResult<DiskANNQueryResult>

Return threshold results and scoring work from their one exact invocation, without a second scan.

Trait Implementations§

Source§

impl DiskANNCanonicalRead for DiskANNQuery<'_>

Source§

fn check_control( &self, control: &StorageReadControl, ) -> StorageBackendResult<()>

Check the retained source’s original controls and the invoking control, including queries that need no provider reads.
Source§

fn dimensions(&self) -> u32

The canonical width, shared by every ordinal on this source.
Source§

fn next_document_after( &self, after: Option<DocId>, control: &StorageReadControl, ) -> StorageBackendResult<Option<DocId>>

Return the least live document strictly after after from the union of canonical keys and origin keys. Include empty replacements and unstamped canonical values; read key metadata only, with bounded workspace.
Source§

fn origin( &self, document: DocId, control: &StorageReadControl, ) -> StorageBackendResult<Option<DiskANNVectorVersion>>

Validate the complete ordinal set before returning its origin. Absence and an explicit empty replacement remain distinct.
Source§

fn visit_document( &self, document: DocId, control: &StorageReadControl, visit: &mut DiskANNCanonicalVectorVisitor<'_>, ) -> StorageBackendResult<Option<DiskANNVectorVersion>>

Stream every visible ordinal, preserving coordinate bits and checking the complete tensor’s origin and shape. Use bounded point reads and a reusable charged vector buffer.
Source§

fn population_counts( &self, _generation: DiskANNGeneration, control: &StorageReadControl, ) -> StorageBackendResult<Option<DiskANNCanonicalCounts>>

Exact owner-maintained counts for this canonical view and the requested build coverage. Unsupported associations return None; this operation must not enumerate documents, journals or origin pages to reconstruct counts.
Source§

fn corpus_fingerprint( &self, control: &StorageReadControl, ) -> StorageBackendResult<Option<[u8; 32]>>

Identity of the complete selected canonical field, independent of graph generations. Unsupported sources cannot authorize fixed-model reuse.
Source§

fn read_vector( &self, document: DocId, ordinal: u32, control: &StorageReadControl, ) -> StorageBackendResult<Option<BudgetedVec<f32>>>

Own one canonical ordinal so consumers can compare independent fixed sources without nested provider callbacks. Physical owners override this default with bounded point reads.
Source§

fn visit_all( &self, control: &StorageReadControl, visit: &mut DiskANNCanonicalCorpusVisitor<'_>, ) -> StorageBackendResult<()>

Stream the entire fixed source in document/ordinal order without retaining a corpus directory. Empty replacements are validated but emit no vectors; unstamped values fail instead of disappearing from the corpus.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for DiskANNQuery<'a>

§

impl<'a> !Send for DiskANNQuery<'a>

§

impl<'a> !Sync for DiskANNQuery<'a>

§

impl<'a> !UnwindSafe for DiskANNQuery<'a>

§

impl<'a> Freeze for DiskANNQuery<'a>

§

impl<'a> Unpin for DiskANNQuery<'a>

§

impl<'a> UnsafeUnpin for DiskANNQuery<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.