pub struct DenseVectorQuery {
pub field: Field,
pub vector: Vec<f32>,
pub nprobe: usize,
pub rerank_factor: f32,
pub combiner: MultiValueCombiner,
/* private fields */
}Expand description
Dense vector query for similarity search
Fields§
§field: FieldField containing the dense vectors
vector: Vec<f32>Query vector
nprobe: usizeNumber of clusters to probe (for IVF indexes)
rerank_factor: f32Re-ranking factor multiplied by k for candidate selection (1x to 2x)
combiner: MultiValueCombinerHow to combine scores for multi-valued documents
Implementations§
Source§impl DenseVectorQuery
impl DenseVectorQuery
Sourcepub fn with_nprobe(self, nprobe: usize) -> Self
pub fn with_nprobe(self, nprobe: usize) -> Self
Set the number of clusters to probe (for IVF indexes)
Values are validated when the query is executed. See
MAX_DENSE_NPROBE.
Sourcepub fn with_rerank_factor(self, factor: f32) -> Self
pub fn with_rerank_factor(self, factor: f32) -> Self
Set the re-ranking factor (e.g. 2.0 = fetch 2x candidates for reranking)
Values are validated when the query is executed. See
MAX_DENSE_RERANK_FACTOR.
Sourcepub fn with_combiner(self, combiner: MultiValueCombiner) -> Self
pub fn with_combiner(self, combiner: MultiValueCombiner) -> Self
Set the multi-value score combiner
Trait Implementations§
Source§impl Clone for DenseVectorQuery
impl Clone for DenseVectorQuery
Source§impl Debug for DenseVectorQuery
impl Debug for DenseVectorQuery
Source§impl Display for DenseVectorQuery
impl Display for DenseVectorQuery
Source§impl Query for DenseVectorQuery
impl Query for DenseVectorQuery
Source§fn candidate_query(&self) -> Result<CandidateQuery>
fn candidate_query(&self) -> Result<CandidateQuery>
Exact scoring plan for a named L1 branch. Unsupported queries
reject explicitly rather than returning truncated retrieval scores.
Source§fn scorer<'a>(
&self,
reader: &'a SegmentReader,
limit: usize,
) -> ScorerFuture<'a>
fn scorer<'a>( &self, reader: &'a SegmentReader, limit: usize, ) -> ScorerFuture<'a>
Create a scorer for this query against a single segment (async) Read more
Source§fn scorer_sync<'a>(
&self,
reader: &'a SegmentReader,
limit: usize,
) -> Result<Box<dyn Scorer + 'a>>
fn scorer_sync<'a>( &self, reader: &'a SegmentReader, limit: usize, ) -> Result<Box<dyn Scorer + 'a>>
Create a scorer synchronously (mmap/RAM only). Read more
Source§fn count_estimate<'a>(&self, _reader: &'a SegmentReader) -> CountFuture<'a>
fn count_estimate<'a>(&self, _reader: &'a SegmentReader) -> CountFuture<'a>
Estimated number of matching documents in a segment (async)
Source§fn scorer_with_options<'a>(
&self,
reader: &'a SegmentReader,
limit: usize,
options: ScorerOptions,
) -> ScorerFuture<'a>
fn scorer_with_options<'a>( &self, reader: &'a SegmentReader, limit: usize, options: ScorerOptions, ) -> ScorerFuture<'a>
Create a scorer with collector-specific construction options.
Query implementations that can avoid optional position data
should override this; the default preserves existing behavior.
Source§fn scorer_sync_with_options<'a>(
&self,
reader: &'a SegmentReader,
limit: usize,
options: ScorerOptions,
) -> Result<Box<dyn Scorer + 'a>>
fn scorer_sync_with_options<'a>( &self, reader: &'a SegmentReader, limit: usize, options: ScorerOptions, ) -> Result<Box<dyn Scorer + 'a>>
Synchronous counterpart to
Query::scorer_with_options.Source§fn decompose(&self) -> QueryDecomposition
fn decompose(&self) -> QueryDecomposition
Decompose this query for MaxScore optimization. Read more
Source§fn physical_text_field(
&self,
_reader: &SegmentReader,
_complete: bool,
) -> Option<Field>
fn physical_text_field( &self, _reader: &SegmentReader, _complete: bool, ) -> Option<Field>
Opt into one field-local physical address space for collection.
Every child must honor the internal scorer scope. Unknown/custom
queries retain logical IDs. Ranked term/union executors may keep
their existing mapping by opting in only for complete streams.
Source§fn sparse_decomposition(&self) -> QueryDecomposition
fn sparse_decomposition(&self) -> QueryDecomposition
Sparse terms for query-global BMP superblock planning only.
Unlike scoring decomposition, this never replaces a query’s
scorer. A filter wrapper may expose its inner sparse query here
while remaining opaque to Boolean scoring optimizations.
Source§fn text_terms(&self, out: &mut Vec<(Field, Vec<u8>)>)
fn text_terms(&self, out: &mut Vec<(Field, Vec<u8>)>)
Append every
(field, term) this query scores with BM25 to
out. The searcher aggregates their document frequencies
across segments before scoring (see ScorerOptions::global_stats).Source§fn is_filter(&self) -> bool
fn is_filter(&self) -> bool
True if this query is a pure filter (always scores 1.0, no positions).
Used by the planner to convert non-selective MUST filters into predicates.
Source§fn as_doc_predicate<'a>(
&self,
_reader: &'a SegmentReader,
) -> Option<DocPredicate<'a>>
fn as_doc_predicate<'a>( &self, _reader: &'a SegmentReader, ) -> Option<DocPredicate<'a>>
For filter queries: return a cheap per-doc predicate against a segment.
The predicate does O(1) work per doc (e.g., fast-field lookup).
Source§fn as_doc_bitset(&self, _reader: &SegmentReader) -> Option<DocBitset>
fn as_doc_bitset(&self, _reader: &SegmentReader) -> Option<DocBitset>
Build a compact bitset of matching doc_ids for this query. Read more
Source§fn as_doc_bitset_with_options(
&self,
reader: &SegmentReader,
options: &ScorerOptions,
) -> Option<DocBitset>
fn as_doc_bitset_with_options( &self, reader: &SegmentReader, options: &ScorerOptions, ) -> Option<DocBitset>
Budget-aware materialization.
None means unsupported or
cancelled; cancellation must flag the shared budget, and a
partial bitset must never escape as a complete filter.Source§fn bitset_cardinality_estimate(&self, _reader: &SegmentReader) -> Option<u64>
fn bitset_cardinality_estimate(&self, _reader: &SegmentReader) -> Option<u64>
Cheap estimate of how many docs this filter clause matches in
the segment. Used by the boolean planner to order MUST/MUST_NOT
evaluation: the narrowest clause is materialized first and wider
clauses refine it with per-doc probes instead of being fully
materialized.
None = unknown (treated as matching everything).Source§fn count_equivalent_term(&self) -> Option<TermQueryInfo>
fn count_equivalent_term(&self) -> Option<TermQueryInfo>
A term with identical membership for count-only collection.
This does not change scoring decomposition. The collector must
still account for deleted rows, chunks and missing metadata.
Source§fn ranked_count_equivalent_term(&self) -> Option<TermQueryInfo>
fn ranked_count_equivalent_term(&self) -> Option<TermQueryInfo>
A term-equivalent cardinality alongside an exact score-only
text rank plan. Unlike the count-only hint, opaque/custom plans
do not opt in automatically. The collector still validates the
indexed document space, deletions, mappings and cardinality gate.
Source§fn supports_ranked_conjunction_count(&self) -> bool
fn supports_ranked_conjunction_count(&self) -> bool
Opt into top-level bounded conjunction results with an exact
count. Wrappers must not inherit this automatically: they may
consume or hide a child’s cardinality. Defaults to streaming.
Auto Trait Implementations§
impl !Freeze for DenseVectorQuery
impl RefUnwindSafe for DenseVectorQuery
impl Send for DenseVectorQuery
impl Sync for DenseVectorQuery
impl Unpin for DenseVectorQuery
impl UnsafeUnpin for DenseVectorQuery
impl UnwindSafe for DenseVectorQuery
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<E> ResultError for E
impl<T> ResultType for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more