pub struct ReadOnlySnapshot<T: ?Sized>(/* private fields */);Expand description
Adapt an already captured snapshot to an owned read-only handle without copying its contents. The caller must supply the snapshot selected for its visibility boundary; this adapter does not capture or advance that boundary.
Implementations§
Source§impl<T: VectorRead + 'static> ReadOnlySnapshot<T>
impl<T: VectorRead + 'static> ReadOnlySnapshot<T>
Sourcepub fn with_canonical_vectors(
self,
control: Option<&StorageReadControl>,
) -> StorageBackendResult<Self>
pub fn with_canonical_vectors( self, control: Option<&StorageReadControl>, ) -> StorageBackendResult<Self>
Expose canonical values from an already captured immutable owner without copying coordinates or its directory. Cache owners may remain unbound; each reader later binds its own cancellation. A supplied control admits the facet header, while None preserves the existing uncontrolled snapshot API. The unique view identity is conservative across independently captured equal corpora and stable across shared/nested readers.
Source§impl ReadOnlySnapshot<dyn InvertedIndex>
impl ReadOnlySnapshot<dyn InvertedIndex>
Sourcepub fn from_budgeted_inverted<T: InvertedIndex + 'static>(
snapshot: Budgeted<T>,
) -> StorageBackendResult<Self>
pub fn from_budgeted_inverted<T: InvertedIndex + 'static>( snapshot: Budgeted<T>, ) -> StorageBackendResult<Self>
Erase a captured provider’s concrete type after reserving its shared allocation, keeping all producer leases with the immutable index.
Source§impl<T: InvertedIndex + ?Sized> ReadOnlySnapshot<T>
impl<T: InvertedIndex + ?Sized> ReadOnlySnapshot<T>
Sourcepub fn with_inverted_read_control(
self,
control: &StorageReadControl,
) -> StorageBackendResult<Self>
pub fn with_inverted_read_control( self, control: &StorageReadControl, ) -> StorageBackendResult<Self>
Retain the first selected read control. Generation reservations can be shared without giving an unrelated reader the prior reader’s cancellation signal.
Source§impl<T: VectorIndex + ?Sized> ReadOnlySnapshot<T>
impl<T: VectorIndex + ?Sized> ReadOnlySnapshot<T>
Sourcepub fn with_vector_read_control(
self,
control: &StorageReadControl,
) -> StorageBackendResult<Self>
pub fn with_vector_read_control( self, control: &StorageReadControl, ) -> StorageBackendResult<Self>
Select query control for an already captured physical value. Cache owners bind each returned reader separately; nested readers preserve the first selected allowance and cancellation token.
Source§impl<T> ReadOnlySnapshot<T>
impl<T> ReadOnlySnapshot<T>
Sourcepub fn from_budgeted(snapshot: Budgeted<T>) -> StorageBackendResult<Self>
pub fn from_budgeted(snapshot: Budgeted<T>) -> StorageBackendResult<Self>
Share a captured value without separating its allocations from their original allowance.
Trait Implementations§
Source§impl<T: ?Sized> Clone for ReadOnlySnapshot<T>
impl<T: ?Sized> Clone for ReadOnlySnapshot<T>
Source§impl<T: ?Sized> Deref for ReadOnlySnapshot<T>
impl<T: ?Sized> Deref for ReadOnlySnapshot<T>
Source§impl DocumentStore for ReadOnlySnapshot<dyn DocumentStore>
impl DocumentStore for ReadOnlySnapshot<dyn DocumentStore>
Source§fn put_stored(
&mut self,
_doc_id: DocId,
_document: StoredDocument,
) -> StorageBackendResult<()>
fn put_stored( &mut self, _doc_id: DocId, _document: StoredDocument, ) -> StorageBackendResult<()>
Source§fn get_stored(
&self,
doc_id: DocId,
) -> StorageBackendResult<Option<StoredDocument>>
fn get_stored( &self, doc_id: DocId, ) -> StorageBackendResult<Option<StoredDocument>>
Source§fn get_stored_many_controlled(
&self,
ids: &[DocId],
control: &StorageReadControl,
) -> StorageBackendResult<RetainedDocumentPage>
fn get_stored_many_controlled( &self, ids: &[DocId], control: &StorageReadControl, ) -> StorageBackendResult<RetainedDocumentPage>
Source§fn with_field_ref_controlled(
&self,
id: DocId,
field: &str,
control: &StorageReadControl,
visitor: &mut dyn FnMut(Option<&Value>) -> StorageBackendResult<()>,
) -> StorageBackendResult<()>
fn with_field_ref_controlled( &self, id: DocId, field: &str, control: &StorageReadControl, visitor: &mut dyn FnMut(Option<&Value>) -> StorageBackendResult<()>, ) -> StorageBackendResult<()>
Source§fn field_presence_controlled(
&self,
ids: &[DocId],
fields: &[&str],
control: &StorageReadControl,
) -> StorageBackendResult<BudgetedVec<bool>>
fn field_presence_controlled( &self, ids: &[DocId], fields: &[&str], control: &StorageReadControl, ) -> StorageBackendResult<BudgetedVec<bool>>
Source§fn put(
&mut self,
_doc_id: DocId,
_document: Document,
) -> StorageBackendResult<()>
fn put( &mut self, _doc_id: DocId, _document: Document, ) -> StorageBackendResult<()>
DocumentStore::put_stored with the new metadata explicitly.fn get(&self, doc_id: DocId) -> StorageBackendResult<Option<Document>>
Source§fn get_stored_many(
&self,
doc_ids: &[DocId],
) -> StorageBackendResult<BTreeMap<DocId, StoredDocument>>
fn get_stored_many( &self, doc_ids: &[DocId], ) -> StorageBackendResult<BTreeMap<DocId, StoredDocument>>
DocumentStore::get_stored.Source§fn get_metadata(
&self,
doc_id: DocId,
) -> StorageBackendResult<Option<DocumentMetadata>>
fn get_metadata( &self, doc_id: DocId, ) -> StorageBackendResult<Option<DocumentMetadata>>
fn contains_doc_id(&self, doc_id: DocId) -> StorageBackendResult<bool>
fn delete(&mut self, _doc_id: DocId) -> StorageBackendResult<()>
fn clear(&mut self) -> StorageBackendResult<()>
Source§fn get_field(
&self,
doc_id: DocId,
field: &str,
) -> StorageBackendResult<Option<Value>>
fn get_field( &self, doc_id: DocId, field: &str, ) -> StorageBackendResult<Option<Value>>
Value so persistent
backends (SQLite, …) can decode on demand without reaching
for a reference into a transient row.Source§fn find_doc_id_by_field(
&self,
field: &str,
value: &Value,
) -> StorageBackendResult<Option<DocId>>
fn find_doc_id_by_field( &self, field: &str, value: &Value, ) -> StorageBackendResult<Option<DocId>>
value.
Persistent stores can override this with an indexed or JSON-path
lookup so point updates do not have to materialise every row.Source§fn patch_fields(
&mut self,
_doc_id: DocId,
_updates: &BTreeMap<String, Value>,
) -> StorageBackendResult<bool>
fn patch_fields( &mut self, _doc_id: DocId, _updates: &BTreeMap<String, Value>, ) -> StorageBackendResult<bool>
Value::Null matches put by
removing the stored field. Ok(false) means the document does
not exist; write failures surface as Err.Source§fn get_many(
&self,
doc_ids: &[DocId],
) -> StorageBackendResult<BTreeMap<DocId, Document>>
fn get_many( &self, doc_ids: &[DocId], ) -> StorageBackendResult<BTreeMap<DocId, Document>>
DocumentStore::get. Ids without a stored
document are absent from the result. The default implementation
walks each id one at a time; persistent backends should
override to batch the reads into few queries.Source§fn get_fields_multi(
&self,
doc_ids: &[DocId],
fields: &[&str],
) -> StorageBackendResult<BTreeMap<DocId, Vec<Value>>>
fn get_fields_multi( &self, doc_ids: &[DocId], fields: &[&str], ) -> StorageBackendResult<BTreeMap<DocId, Vec<Value>>>
fields; missing fields come back as
Value::Null, ids without a document are absent. Persistent
backends override this to extract all fields in one scan
instead of materialising whole documents.Source§fn for_each_fields_multi(
&self,
doc_ids: &[DocId],
fields: &[&str],
visitor: &mut dyn FnMut(DocId, Vec<Value>) -> bool,
) -> StorageBackendResult<()>
fn for_each_fields_multi( &self, doc_ids: &[DocId], fields: &[&str], visitor: &mut dyn FnMut(DocId, Vec<Value>) -> bool, ) -> StorageBackendResult<()>
false stops the visit early. Missing documents yield
a row of NULLs, matching row-evaluator semantics.Source§fn for_each_fields_multi_ref(
&self,
doc_ids: &[DocId],
fields: &[&str],
visitor: &mut dyn FnMut(DocId, &[&Value]) -> bool,
) -> StorageBackendResult<()>
fn for_each_fields_multi_ref( &self, doc_ids: &[DocId], fields: &[&str], visitor: &mut dyn FnMut(DocId, &[&Value]) -> bool, ) -> StorageBackendResult<()>
Source§fn for_each_fields_multi_ref_with_presence(
&self,
doc_ids: &[DocId],
fields: &[&str],
visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool,
) -> StorageBackendResult<()>
fn for_each_fields_multi_ref_with_presence( &self, doc_ids: &[DocId], fields: &[&str], visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool, ) -> StorageBackendResult<()>
contains_doc_id probe when a
caller must distinguish a missing document from an existing document
whose requested fields are all NULL.doc_ids as shared positional projections
when the backend owns stable decoded value vectors. None means the
backend does not support zero-copy projection; entries inside the
returned vector are None only for missing document ids.Source§fn get_fields_bulk(
&self,
doc_ids: &[DocId],
field: &str,
) -> StorageBackendResult<BTreeMap<DocId, Value>>
fn get_fields_bulk( &self, doc_ids: &[DocId], field: &str, ) -> StorageBackendResult<BTreeMap<DocId, Value>>
DocumentStore::get_field. The default
implementation walks each id one at a time; persistent backends
should override to run a single batched query.Source§fn has_value(&self, field: &str, value: &Value) -> StorageBackendResult<bool>
fn has_value(&self, field: &str, value: &Value) -> StorageBackendResult<bool>
true if any document has field == value.Source§fn find_doc_id_by_fields(
&self,
fields: &[String],
values: &[Value],
) -> StorageBackendResult<Option<DocId>>
fn find_doc_id_by_fields( &self, fields: &[String], values: &[Value], ) -> StorageBackendResult<Option<DocId>>
Source§fn eval_path(
&self,
doc_id: DocId,
path: &[PathSegment],
) -> StorageBackendResult<Option<Value>>
fn eval_path( &self, doc_id: DocId, path: &[PathSegment], ) -> StorageBackendResult<Option<Value>>
fn doc_ids(&self) -> StorageBackendResult<Vec<DocId>>
Source§fn next_doc_id(
&self,
after: Option<DocId>,
) -> StorageBackendResult<Option<DocId>>
fn next_doc_id( &self, after: Option<DocId>, ) -> StorageBackendResult<Option<DocId>>
after, or
the first id when after is None. Scan operators use this cursor API
so a full table scan does not need a cardinality-sized id vector before
it can yield its first row.Source§fn next_doc_ids(
&self,
after: Option<DocId>,
limit: usize,
) -> StorageBackendResult<Vec<DocId>>
fn next_doc_ids( &self, after: Option<DocId>, limit: usize, ) -> StorageBackendResult<Vec<DocId>>
limit document ids strictly greater than after, in
ascending order. Scan operators use this bounded cursor instead of
reacquiring their store lock and issuing one backend lookup per row.Source§fn next_doc_ids_controlled(
&self,
after: Option<DocId>,
limit: usize,
control: &StorageReadControl,
) -> StorageBackendResult<BudgetedVec<DocId>>
fn next_doc_ids_controlled( &self, after: Option<DocId>, limit: usize, control: &StorageReadControl, ) -> StorageBackendResult<BudgetedVec<DocId>>
limit identities in strictly ascending order after after, retaining the supplied allowance with the output. Implementations reserve producer scratch and output before allocation, preserve this store’s selected view, and never read document payloads. The default rejects unsupported providers without calling an unbounded owned cursor; empty requests still honor cancellation. Controlled consumers use read_document_ids to validate the returned page and its allowance.None lets persistent backends use the ordinary id + projection path.Source§fn for_each_next_fields(
&self,
after: Option<DocId>,
limit: usize,
fields: &[&str],
visitor: &mut dyn FnMut(DocId, &[&Value]) -> bool,
) -> StorageBackendResult<Option<usize>>
fn for_each_next_fields( &self, after: Option<DocId>, limit: usize, fields: &[&str], visitor: &mut dyn FnMut(DocId, &[&Value]) -> bool, ) -> StorageBackendResult<Option<usize>>
Some(count) means the backend supports this borrowed cursor and reports how many rows it visited; None selects the ordinary cursor path without invoking visitor.fn max_doc_id(&self) -> StorageBackendResult<DocId>
Source§fn for_each_next_fields_borrowed(
&self,
after: Option<DocId>,
limit: usize,
fields: &[&str],
visitor: &mut dyn FnMut(DocId, &[&Value]) -> bool,
) -> StorageBackendResult<Option<usize>>
fn for_each_next_fields_borrowed( &self, after: Option<DocId>, limit: usize, fields: &[&str], visitor: &mut dyn FnMut(DocId, &[&Value]) -> bool, ) -> StorageBackendResult<Option<usize>>
visitor. Missing fields are SQL NULL; stopping the visitor must not decode later rows. None must leave the visitor uncalled. Providers without a physical borrow reuse their ordinary projected cursor.Source§fn for_each_fields_multi_borrowed(
&self,
ids: &[DocId],
fields: &[&str],
visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool,
) -> StorageBackendResult<Option<usize>>
fn for_each_fields_multi_borrowed( &self, ids: &[DocId], fields: &[&str], visitor: &mut dyn FnMut(DocId, bool, &[&Value]) -> bool, ) -> StorageBackendResult<Option<usize>>
Some(count) counts callbacks; None must leave the visitor uncalled and selects the ordinary projection path.fn len(&self) -> StorageBackendResult<usize>
fn is_empty(&self) -> StorageBackendResult<bool>
Source§fn iter_all(
&self,
) -> StorageBackendResult<Box<dyn Iterator<Item = (DocId, Document)> + '_>>
fn iter_all( &self, ) -> StorageBackendResult<Box<dyn Iterator<Item = (DocId, Document)> + '_>>
(doc_id, document) pairs in id order. The default
implementation fetches each document individually; SQLite-backed
stores override with a single query.Source§fn snapshot(&self) -> StorageBackendResult<Arc<dyn DocumentStore>>
fn snapshot(&self) -> StorageBackendResult<Arc<dyn DocumentStore>>
ExecutionContext. Persistent
backends share their connection; memory backends deep-clone so the
snapshot is isolated from later mutations.Source§fn retained_snapshot(
&self,
) -> StorageBackendResult<Option<Arc<dyn DocumentStore>>>
fn retained_snapshot( &self, ) -> StorageBackendResult<Option<Arc<dyn DocumentStore>>>
snapshot method, whose persistent implementations may share a mutable connection.Source§fn put_stored_unused(
&mut self,
doc_id: DocId,
document: StoredDocument,
namespace: DocumentIdNamespace,
) -> StorageBackendResult<()>
fn put_stored_unused( &mut self, doc_id: DocId, document: StoredDocument, namespace: DocumentIdNamespace, ) -> StorageBackendResult<()>
namespace. A provider that keys its records by that namespace may write them without reading what they would replace, and only while it stores the table under that namespace; a record that exists after all fails the commit. The default replaces as put_stored does.Source§fn writable_snapshot(&self) -> StorageBackendResult<Box<dyn DocumentStore>>
fn writable_snapshot(&self) -> StorageBackendResult<Box<dyn DocumentStore>>
Source§impl InvertedIndex for ReadOnlySnapshot<dyn InvertedIndex>
impl InvertedIndex for ReadOnlySnapshot<dyn InvertedIndex>
Source§fn source_rebuild_required(&self) -> StorageBackendResult<bool>
fn source_rebuild_required(&self) -> StorageBackendResult<bool>
fn analyzer(&self) -> &Analyzer
Source§fn default_analyzer_binding(&self) -> StorageBackendResult<AnalyzerDefault>
fn default_analyzer_binding(&self) -> StorageBackendResult<AnalyzerDefault>
fn add_document( &mut self, _doc_id: DocId, _fields: BTreeMap<FieldName, String>, ) -> StorageBackendResult<()>
fn try_add_document( &mut self, _doc_id: DocId, _fields: BTreeMap<FieldName, String>, ) -> StorageBackendResult<()>
Source§fn try_add_documents(
&mut self,
_documents: Vec<(DocId, BTreeMap<FieldName, String>)>,
) -> StorageBackendResult<()>
fn try_add_documents( &mut self, _documents: Vec<(DocId, BTreeMap<FieldName, String>)>, ) -> StorageBackendResult<()>
Source§fn try_add_documents_observed(
&mut self,
_documents: Vec<(DocId, BTreeMap<FieldName, String>)>,
_visit: &mut InvertedIndexChangeVisitor<'_>,
) -> StorageBackendResult<()>
fn try_add_documents_observed( &mut self, _documents: Vec<(DocId, BTreeMap<FieldName, String>)>, _visit: &mut InvertedIndexChangeVisitor<'_>, ) -> StorageBackendResult<()>
Source§fn try_remove_document_observed(
&mut self,
_doc_id: DocId,
_visit: &mut InvertedIndexChangeVisitor<'_>,
) -> StorageBackendResult<()>
fn try_remove_document_observed( &mut self, _doc_id: DocId, _visit: &mut InvertedIndexChangeVisitor<'_>, ) -> StorageBackendResult<()>
fn remove_document(&mut self, _doc_id: DocId) -> StorageBackendResult<()>
fn try_remove_document(&mut self, _doc_id: DocId) -> StorageBackendResult<()>
fn clear(&mut self) -> StorageBackendResult<()>
fn try_clear(&mut self) -> StorageBackendResult<()>
fn try_rebuild_documents( &mut self, _documents: Vec<(DocId, BTreeMap<FieldName, String>)>, ) -> StorageBackendResult<()>
fn get_posting_list( &self, field: &str, term: &str, ) -> StorageBackendResult<PostingList>
Source§fn get_posting_list_key(
&self,
field: &str,
term: &TokenTermKey,
) -> StorageBackendResult<PostingList>
fn get_posting_list_key( &self, field: &str, term: &TokenTermKey, ) -> StorageBackendResult<PostingList>
Source§fn posting_cursor_key(
&self,
field: &str,
term: &TokenTermKey,
) -> StorageBackendResult<Box<dyn PostingCursor>>
fn posting_cursor_key( &self, field: &str, term: &TokenTermKey, ) -> StorageBackendResult<Box<dyn PostingCursor>>
Source§fn posting_read_cursor_key<'a>(
&'a self,
field: &'a str,
term: &TokenTermKey,
) -> StorageBackendResult<Box<dyn PostingReadCursor + 'a>>
fn posting_read_cursor_key<'a>( &'a self, field: &'a str, term: &TokenTermKey, ) -> StorageBackendResult<Box<dyn PostingReadCursor + 'a>>
Source§fn posting_read_cursor_key_budgeted<'a>(
&'a self,
field: &'a str,
term: &'a TokenTermKey,
control: &StorageReadControl,
) -> StorageBackendResult<BudgetedPostingReadCursor<'a>>
fn posting_read_cursor_key_budgeted<'a>( &'a self, field: &'a str, term: &'a TokenTermKey, control: &StorageReadControl, ) -> StorageBackendResult<BudgetedPostingReadCursor<'a>>
Source§fn visit_score_clusters(
&self,
field: &str,
term: &TokenTermKey,
after: Option<u64>,
limit: usize,
control: &StorageReadControl,
visit: &mut ScoreClusterVisitor<'_>,
) -> StorageBackendResult<()>
fn visit_score_clusters( &self, field: &str, term: &TokenTermKey, after: Option<u64>, limit: usize, control: &StorageReadControl, visit: &mut ScoreClusterVisitor<'_>, ) -> StorageBackendResult<()>
Source§fn get_occurrences_budgeted(
&self,
doc_id: DocId,
field: &str,
term: &TokenTermKey,
control: &StorageReadControl,
) -> StorageBackendResult<Budgeted<Vec<TokenOccurrence>>>
fn get_occurrences_budgeted( &self, doc_id: DocId, field: &str, term: &TokenTermKey, control: &StorageReadControl, ) -> StorageBackendResult<Budgeted<Vec<TokenOccurrence>>>
Source§fn get_occurrence_postings(
&self,
field: &str,
term: &TokenTermKey,
) -> StorageBackendResult<Vec<OccurrencePosting>>
fn get_occurrence_postings( &self, field: &str, term: &TokenTermKey, ) -> StorageBackendResult<Vec<OccurrencePosting>>
Source§fn get_occurrences(
&self,
doc_id: DocId,
field: &str,
term: &TokenTermKey,
) -> StorageBackendResult<Vec<TokenOccurrence>>
fn get_occurrences( &self, doc_id: DocId, field: &str, term: &TokenTermKey, ) -> StorageBackendResult<Vec<TokenOccurrence>>
Source§fn indexed_field_metadata(
&self,
doc_id: DocId,
field: &str,
) -> StorageBackendResult<Option<IndexedFieldMetadata>>
fn indexed_field_metadata( &self, doc_id: DocId, field: &str, ) -> StorageBackendResult<Option<IndexedFieldMetadata>>
fn doc_freq_key( &self, field: &str, term: &TokenTermKey, ) -> StorageBackendResult<u64>
fn get_term_freq_key( &self, doc_id: DocId, field: &str, term: &TokenTermKey, ) -> StorageBackendResult<u64>
Source§fn vocabulary_keys(
&self,
field: &str,
) -> StorageBackendResult<Vec<TokenTermKey>>
fn vocabulary_keys( &self, field: &str, ) -> StorageBackendResult<Vec<TokenTermKey>>
fn get_posting_lists_bulk( &self, field: &str, terms: &[String], ) -> StorageBackendResult<Vec<PostingList>>
Source§fn posting_cursor(
&self,
field: &str,
term: &str,
) -> StorageBackendResult<Box<dyn PostingCursor>>
fn posting_cursor( &self, field: &str, term: &str, ) -> StorageBackendResult<Box<dyn PostingCursor>>
fn posting_cursors_bulk( &self, field: &str, terms: &[String], ) -> StorageBackendResult<Vec<Box<dyn PostingCursor>>>
Source§fn posting_cursors_keys_bulk(
&self,
field: &str,
terms: &[TokenTermKey],
) -> StorageBackendResult<Vec<Box<dyn PostingCursor>>>
fn posting_cursors_keys_bulk( &self, field: &str, terms: &[TokenTermKey], ) -> StorageBackendResult<Vec<Box<dyn PostingCursor>>>
Source§fn get_posting_lists_keys_bulk(
&self,
field: &str,
terms: &[TokenTermKey],
) -> StorageBackendResult<Vec<PostingList>>
fn get_posting_lists_keys_bulk( &self, field: &str, terms: &[TokenTermKey], ) -> StorageBackendResult<Vec<PostingList>>
Source§fn persisted_block_max_scores_keys_bulk(
&self,
field: &str,
terms: &[TokenTermKey],
scorer_fingerprint: &str,
) -> StorageBackendResult<Vec<Option<Vec<f64>>>>
fn persisted_block_max_scores_keys_bulk( &self, field: &str, terms: &[TokenTermKey], scorer_fingerprint: &str, ) -> StorageBackendResult<Vec<Option<Vec<f64>>>>
Source§fn get_scoring_inputs_keys_bulk(
&self,
doc_ids: &[DocId],
field: &str,
terms: &[TokenTermKey],
) -> StorageBackendResult<Vec<(u64, Vec<u64>)>>
fn get_scoring_inputs_keys_bulk( &self, doc_ids: &[DocId], field: &str, terms: &[TokenTermKey], ) -> StorageBackendResult<Vec<(u64, Vec<u64>)>>
Source§fn rebuild_persisted_block_max(
&mut self,
_field: &str,
_scorer: &dyn BlockMaxScorer,
_scorer_fingerprint: &str,
) -> StorageBackendResult<bool>
fn rebuild_persisted_block_max( &mut self, _field: &str, _scorer: &dyn BlockMaxScorer, _scorer_fingerprint: &str, ) -> StorageBackendResult<bool>
field. Read moreSource§fn persisted_block_max_scores(
&self,
field: &str,
term: &str,
scorer_fingerprint: &str,
) -> StorageBackendResult<Option<Vec<f64>>>
fn persisted_block_max_scores( &self, field: &str, term: &str, scorer_fingerprint: &str, ) -> StorageBackendResult<Option<Vec<f64>>>
None means
the backend has no complete, valid materialization for this scorer.Source§fn persisted_block_max_scores_bulk(
&self,
field: &str,
terms: &[String],
scorer_fingerprint: &str,
) -> StorageBackendResult<Vec<Option<Vec<f64>>>>
fn persisted_block_max_scores_bulk( &self, field: &str, terms: &[String], scorer_fingerprint: &str, ) -> StorageBackendResult<Vec<Option<Vec<f64>>>>
Source§fn for_each_posting(
&self,
field: &str,
term: &str,
visit: &mut dyn FnMut(&PostingEntry),
) -> StorageBackendResult<()>
fn for_each_posting( &self, field: &str, term: &str, visit: &mut dyn FnMut(&PostingEntry), ) -> StorageBackendResult<()>
(field, term) in ascending doc-id order without handing out an owned list. Read moreSource§fn for_each_term_freq(
&self,
field: &str,
term: &str,
visit: &mut dyn FnMut(DocId, u64),
) -> StorageBackendResult<()>
fn for_each_term_freq( &self, field: &str, term: &str, visit: &mut dyn FnMut(DocId, u64), ) -> StorageBackendResult<()>
(doc_id, term_frequency) pairs without requiring callers to
materialize or decode payload details they do not use. The default
uses posting support and the authoritative frequency accessor;
persistent backends can stream compact frequency projections.fn doc_freq(&self, field: &str, term: &str) -> StorageBackendResult<u64>
fn get_doc_length( &self, doc_id: DocId, field: &str, ) -> StorageBackendResult<u64>
fn get_term_freq( &self, doc_id: DocId, field: &str, term: &str, ) -> StorageBackendResult<u64>
fn doc_count(&self) -> StorageBackendResult<u64>
fn total_field_length(&self, field: &str) -> StorageBackendResult<u64>
Source§fn field_doc_count(&self, field: &str) -> StorageBackendResult<u64>
fn field_doc_count(&self, field: &str) -> StorageBackendResult<u64>
field.Source§fn field_stats(&self, field: &str) -> StorageBackendResult<IndexStats>
fn field_stats(&self, field: &str) -> StorageBackendResult<IndexStats>
Source§fn field_stats_scalar(&self, field: &str) -> StorageBackendResult<IndexStats>
fn field_stats_scalar(&self, field: &str) -> StorageBackendResult<IndexStats>
InvertedIndex::field_stats without the vocabulary-wide
document-frequency map. Read moreSource§fn field_stats_scalar_budgeted(
&self,
field: &str,
control: &StorageReadControl,
) -> StorageBackendResult<IndexStats>
fn field_stats_scalar_budgeted( &self, field: &str, control: &StorageReadControl, ) -> StorageBackendResult<IndexStats>
Source§fn vocabulary_terms(&self, field: &str) -> StorageBackendResult<Vec<String>>
fn vocabulary_terms(&self, field: &str) -> StorageBackendResult<Vec<String>>
field. Read moreSource§fn stats(&self) -> StorageBackendResult<IndexStats>
fn stats(&self) -> StorageBackendResult<IndexStats>
IndexStats snapshot for the cost model and
scoring layer. Implementations may cache this between mutations.Source§fn posting_count(&self, field: Option<&str>) -> StorageBackendResult<u64>
fn posting_count(&self, field: Option<&str>) -> StorageBackendResult<u64>
field = Some(..), limits the count
to one indexed field.Source§fn doc_length_count(&self, field: Option<&str>) -> StorageBackendResult<u64>
fn doc_length_count(&self, field: Option<&str>) -> StorageBackendResult<u64>
(doc_id, field) length rows. With field = Some(..),
this is the number of documents indexed for that field.Source§fn term_count(&self, field: Option<&str>) -> StorageBackendResult<u64>
fn term_count(&self, field: Option<&str>) -> StorageBackendResult<u64>
field = Some(..), limits
the count to one indexed field.Source§fn snapshot(&self) -> StorageBackendResult<Arc<dyn InvertedIndex>>
fn snapshot(&self) -> StorageBackendResult<Arc<dyn InvertedIndex>>
ExecutionContext.Source§fn snapshot_with_control(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<Arc<dyn InvertedIndex>>
fn snapshot_with_control( &self, control: &StorageReadControl, ) -> StorageBackendResult<Arc<dyn InvertedIndex>>
Source§fn field_names(&self) -> StorageBackendResult<Vec<FieldName>>
fn field_names(&self) -> StorageBackendResult<Vec<FieldName>>
IndexStats snapshot’s
total-length map. Backends with a richer schema can override.Source§fn get_posting_list_any_field(
&self,
term: &str,
) -> StorageBackendResult<PostingList>
fn get_posting_list_any_field( &self, term: &str, ) -> StorageBackendResult<PostingList>
term across every indexed field, unioned
together. Default implementation sums per-field posting lists
via PostingList::merge_union.Source§fn doc_freq_any_field(&self, term: &str) -> StorageBackendResult<u64>
fn doc_freq_any_field(&self, term: &str) -> StorageBackendResult<u64>
term across every indexed field.Source§fn get_total_doc_length(&self, doc_id: DocId) -> StorageBackendResult<u64>
fn get_total_doc_length(&self, doc_id: DocId) -> StorageBackendResult<u64>
Source§fn get_doc_lengths_bulk(
&self,
doc_ids: &[DocId],
field: &str,
) -> StorageBackendResult<BTreeMap<DocId, u64>>
fn get_doc_lengths_bulk( &self, doc_ids: &[DocId], field: &str, ) -> StorageBackendResult<BTreeMap<DocId, u64>>
Source§fn get_term_freqs_bulk(
&self,
doc_ids: &[DocId],
field: &str,
term: &str,
) -> StorageBackendResult<BTreeMap<DocId, u64>>
fn get_term_freqs_bulk( &self, doc_ids: &[DocId], field: &str, term: &str, ) -> StorageBackendResult<BTreeMap<DocId, u64>>
Source§fn get_scoring_inputs_bulk(
&self,
doc_ids: &[DocId],
field: &str,
terms: &[String],
) -> StorageBackendResult<Vec<(u64, Vec<u64>)>>
fn get_scoring_inputs_bulk( &self, doc_ids: &[DocId], field: &str, terms: &[String], ) -> StorageBackendResult<Vec<(u64, Vec<u64>)>>
doc_ids.
Persistent backends override this to collapse the scoring loop’s
per-document point reads into a small number of set-oriented queries.Source§fn get_total_term_freq(
&self,
doc_id: DocId,
term: &str,
) -> StorageBackendResult<u64>
fn get_total_term_freq( &self, doc_id: DocId, term: &str, ) -> StorageBackendResult<u64>
Source§fn set_field_analyzer(
&mut self,
_field: &str,
_analyzer: Analyzer,
_phase: AnalyzerPhase,
) -> Result<(), String>
fn set_field_analyzer( &mut self, _field: &str, _analyzer: Analyzer, _phase: AnalyzerPhase, ) -> Result<(), String>
Both writes to both the index-side and search-side maps; the
default impl errors so backends that don’t support per-field
analyzers fail loud rather than silently dropping the request.Source§fn remove_field_analyzers(&mut self, _field: &str) -> Result<(), String>
fn remove_field_analyzers(&mut self, _field: &str) -> Result<(), String>
field. This is the
inverse of set_field_analyzer(..., Both) and is required when the
final logical FTS index for a field is dropped. The default errors so
a backend cannot silently retain stale analysis behavior.Source§fn get_field_analyzer(&self, field: &str) -> Analyzer
fn get_field_analyzer(&self, field: &str) -> Analyzer
field; falls back to
InvertedIndex::analyzer when no override is set.Source§fn get_search_analyzer(&self, field: &str) -> Analyzer
fn get_search_analyzer(&self, field: &str) -> Analyzer
search_analyzer_revision for execution with exact resource ownership.Source§fn index_analyzer_revision(
&self,
field: &str,
) -> StorageBackendResult<Arc<CompiledAnalyzer>>
fn index_analyzer_revision( &self, field: &str, ) -> StorageBackendResult<Arc<CompiledAnalyzer>>
Source§fn search_analyzer_revision(
&self,
field: &str,
) -> StorageBackendResult<Arc<CompiledAnalyzer>>
fn search_analyzer_revision( &self, field: &str, ) -> StorageBackendResult<Arc<CompiledAnalyzer>>
Source§fn set_field_analyzer_revision(
&mut self,
_field: &str,
_revision: Arc<CompiledAnalyzer>,
_phase: AnalyzerPhase,
) -> Result<(), String>
fn set_field_analyzer_revision( &mut self, _field: &str, _revision: Arc<CompiledAnalyzer>, _phase: AnalyzerPhase, ) -> Result<(), String>
rebuild_with_analyzer_revision instead.Source§fn set_field_analyzer_revisions(
&mut self,
_field: &str,
_index: Arc<CompiledAnalyzer>,
_search: Arc<CompiledAnalyzer>,
) -> Result<(), String>
fn set_field_analyzer_revisions( &mut self, _field: &str, _index: Arc<CompiledAnalyzer>, _search: Arc<CompiledAnalyzer>, ) -> Result<(), String>
Source§fn rebuild_with_analyzer_revision(
&mut self,
_field: &str,
_revision: Arc<CompiledAnalyzer>,
_phase: AnalyzerPhase,
_documents: Vec<(DocId, BTreeMap<FieldName, String>)>,
) -> StorageBackendResult<()>
fn rebuild_with_analyzer_revision( &mut self, _field: &str, _revision: Arc<CompiledAnalyzer>, _phase: AnalyzerPhase, _documents: Vec<(DocId, BTreeMap<FieldName, String>)>, ) -> StorageBackendResult<()>
Source§fn try_rebuild_documents_cancellable(
&mut self,
_documents: Vec<(DocId, BTreeMap<FieldName, String>)>,
_cancellation: &CancellationToken,
) -> StorageBackendResult<()>
fn try_rebuild_documents_cancellable( &mut self, _documents: Vec<(DocId, BTreeMap<FieldName, String>)>, _cancellation: &CancellationToken, ) -> StorageBackendResult<()>
Source§fn rebuild_with_analyzer_revision_cancellable(
&mut self,
_field: &str,
_revision: Arc<CompiledAnalyzer>,
_phase: AnalyzerPhase,
_documents: Vec<(DocId, BTreeMap<FieldName, String>)>,
_cancellation: &CancellationToken,
) -> StorageBackendResult<()>
fn rebuild_with_analyzer_revision_cancellable( &mut self, _field: &str, _revision: Arc<CompiledAnalyzer>, _phase: AnalyzerPhase, _documents: Vec<(DocId, BTreeMap<FieldName, String>)>, _cancellation: &CancellationToken, ) -> StorageBackendResult<()>
Source§fn writable_snapshot(&self) -> StorageBackendResult<Box<dyn InvertedIndex>>
fn writable_snapshot(&self) -> StorageBackendResult<Box<dyn InvertedIndex>>
Source§impl<T: VectorIndex + ?Sized + 'static> VectorIndex for ReadOnlySnapshot<T>
impl<T: VectorIndex + ?Sized + 'static> VectorIndex for ReadOnlySnapshot<T>
fn dimensions(&self) -> u32
fn index_kind(&self) -> &'static str
Source§fn diskann_query_metadata(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<Option<DiskANNQueryMetadata>>
fn diskann_query_metadata( &self, control: &StorageReadControl, ) -> StorageBackendResult<Option<DiskANNQueryMetadata>>
fn add(&mut self, _doc_id: DocId, _vector: Vec<f32>) -> StorageBackendResult<()>
fn add_many( &mut self, _doc_id: DocId, _vectors: Vec<Vec<f32>>, ) -> StorageBackendResult<()>
fn delete(&mut self, _doc_id: DocId) -> StorageBackendResult<()>
fn clear(&mut self) -> StorageBackendResult<()>
fn search_knn( &self, query: &[f32], k: usize, ) -> StorageBackendResult<PostingList>
fn search_threshold( &self, query: &[f32], threshold: f32, ) -> StorageBackendResult<PostingList>
Source§fn search_knn_with_control(
&self,
query: &[f32],
k: usize,
control: &StorageReadControl,
) -> StorageBackendResult<PostingList>
fn search_knn_with_control( &self, query: &[f32], k: usize, control: &StorageReadControl, ) -> StorageBackendResult<PostingList>
Source§fn search_threshold_with_control(
&self,
query: &[f32],
threshold: f32,
control: &StorageReadControl,
) -> StorageBackendResult<PostingList>
fn search_threshold_with_control( &self, query: &[f32], threshold: f32, control: &StorageReadControl, ) -> StorageBackendResult<PostingList>
Source§fn search_knn_with_statistics(
&self,
query: &[f32],
k: usize,
control: Option<&StorageReadControl>,
) -> StorageBackendResult<VectorQueryResult>
fn search_knn_with_statistics( &self, query: &[f32], k: usize, control: Option<&StorageReadControl>, ) -> StorageBackendResult<VectorQueryResult>
Source§fn search_threshold_with_statistics(
&self,
query: &[f32],
threshold: f32,
control: Option<&StorageReadControl>,
) -> StorageBackendResult<VectorQueryResult>
fn search_threshold_with_statistics( &self, query: &[f32], threshold: f32, control: Option<&StorageReadControl>, ) -> StorageBackendResult<VectorQueryResult>
fn count(&self) -> StorageBackendResult<usize>
Source§fn contains_document(&self, doc_id: DocId) -> StorageBackendResult<bool>
fn contains_document(&self, doc_id: DocId) -> StorageBackendResult<bool>
Source§fn initialize(&mut self) -> StorageBackendResult<()>
fn initialize(&mut self) -> StorageBackendResult<()>
Source§fn snapshot(&self) -> StorageBackendResult<Arc<dyn VectorIndex>>
fn snapshot(&self) -> StorageBackendResult<Arc<dyn VectorIndex>>
ExecutionContext.Source§fn vector_read_snapshot(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<Option<VectorReadSnapshot>>
fn vector_read_snapshot( &self, control: &StorageReadControl, ) -> StorageBackendResult<Option<VectorReadSnapshot>>
Source§fn snapshot_with_vector_read(
&self,
source: VectorReadSnapshot,
control: &StorageReadControl,
) -> StorageBackendResult<Option<Arc<dyn VectorIndex>>>
fn snapshot_with_vector_read( &self, source: VectorReadSnapshot, control: &StorageReadControl, ) -> StorageBackendResult<Option<Arc<dyn VectorIndex>>>
DiskANN generation while reading a different fixed canonical field view. The query owner verifies raw coverage without inventing mutation origins.Source§fn diskann_read_snapshot(
&self,
control: &StorageReadControl,
) -> StorageBackendResult<Option<DiskANNReadSnapshot>>
fn diskann_read_snapshot( &self, control: &StorageReadControl, ) -> StorageBackendResult<Option<DiskANNReadSnapshot>>
DiskANN canonical source for evaluated document replacements. Capturing metadata does not execute or observe a vector query; other physical methods leave this capability absent.Source§fn snapshot_with_diskann_changes(
&self,
changes: &DiskANNReadChanges,
control: &StorageReadControl,
) -> StorageBackendResult<Option<Arc<dyn VectorIndex>>>
fn snapshot_with_diskann_changes( &self, changes: &DiskANNReadChanges, control: &StorageReadControl, ) -> StorageBackendResult<Option<Arc<dyn VectorIndex>>>
DiskANN generation with the selected actual canonical replacements. Wrappers preserve their original read observation and retention boundary on the returned index. Unsupported methods return None without changing physical selection.