Skip to main content

Module query

Module query 

Source
Expand description

Query types and search execution

Re-exports§

pub use candidate_scoring::CandidateFeature;
pub use candidate_scoring::CandidateQuery;
pub use candidate_scoring::CandidateScores;
pub use candidate_scoring::CandidateScoringPlan;
pub use candidate_scoring::PassageFeatures;
pub use candidate_scoring::RankingModel;
pub use candidate_scoring::ScoreScope;
pub use candidate_scoring::ScoredCandidate;
pub use docset::*;

Modules§

candidate_scoring
Named scores over a bounded candidate union: preserve organic retrieval values, optionally backfill missing cells, and apply the compiled formula.
docset
DocSet trait and concrete implementations for document iteration.

Structs§

AllQuery
Matches every document, including documents with missing fields.
BinaryDenseVectorQuery
Binary dense vector query for Hamming distance similarity search
Bm25Params
Per-field BM25 parameters (indexed<k1: ..., b: ...> in the schema).
BooleanQuery
Boolean query with MUST, SHOULD, and MUST_NOT clauses
BoostQuery
Boost query - multiplies the score of the inner query
CountCollector
Collector that counts all matching documents
DenseVectorQuery
Dense vector query for similarity search
DocAddress
Unique document address: segment_id + local doc_id within segment. Stores segment_id as u128 internally (16 bytes) but serializes as hex string for backward compatibility with JSON/gRPC clients.
DocBitset
Compact bitset indexed by doc_id. O(1) lookup, ~2.25 MB for 18M docs.
EmptyScorer
Empty scorer for terms that don’t exist
FilteredQuery
GlobalStats
Global statistics aggregated across all segments (legacy)
GlobalStatsBuilder
Builder for aggregating statistics from multiple segments
GlobalStatsCache
Cached global statistics with automatic invalidation
HeapEntry
Entry for top-k min-heap
LazyGlobalStats
Lazy global statistics bound to a fixed set of segments
MatchedField
Matched field info with ordinals (for multi-valued fields)
MaxScoreExecutor
Unified Block-Max MaxScore executor for top-k retrieval
PhraseQuery
Phrase query - matches documents containing terms in consecutive positions
PrefixQuery
Prefix query — matches documents containing any term starting with prefix.
ProximityConfig
Proximity rescoring of a text query (MatchQuery.proximity_weight).
RangeQuery
Fast-field range query.
RegexQuery
Constant-score union of indexed terms matching a whole regular expression.
RerankerConfig
Configuration for L2 dense/binary vector reranking
RrfContribution
One vote from a branch’s complete nomination list, before backfill.
RrfRankedList
A nomination branch. None scope preserves legacy chunk fusion semantics.
RrfScore
ScoreCollector
Efficient top-k collector using min-heap (internal, scoring-layer)
ScoredDoc
Search result from MaxScore execution
ScoredPosition
A scored position/ordinal within a field For text fields: position is the token position For vector fields: position is the ordinal (which vector in multi-value)
ScorerOptions
Options that affect scorer construction rather than scoring semantics.
SearchHit
Search hit with unique document address and score
SearchResponse
Search response with hits (IDs only, no documents)
SearchResult
Search result with doc_id and score (internal use)
SharedThreshold
Cross-segment top-k score floor, shared across the parallel/concurrent per-segment searches of a single query.
SparseFieldStats
Statistics for a sparse vector field
SparseTermQuery
Query for a single sparse vector dimension.
SparseTermQueryInfo
Info for MaxScore-optimizable sparse term queries
SparseVectorQuery
Sparse vector query for similarity search
TermQuery
Term query - matches documents containing a specific term
TermQueryInfo
Info for MaxScore-optimizable term queries
TextFieldStats
Statistics for a full-text field
TopKCollector
Collector for top-k results
WildcardQuery
Constant-score union of indexed terms matching a whole-term wildcard.

Enums§

FusionMethod
Method for fusing multiple ranked result lists.
LengthSource
Where a text cursor reads the length of a scoring unit: chunk lengths of a chunked field, or the persisted per-document field lengths (norms) of a plain field. Without either, tf stands in for the length.
MultiValueCombiner
Strategy for combining scores when a document has multiple values for the same field
QueryDecomposition
Decomposition of a query for MaxScore optimization.
RangeBound
Inclusive range bounds in the user’s type domain.

Constants§

BM25_B
BM25 b parameter - controls length normalization 0 = no length normalization, 1 = full normalization
BM25_K1
BM25 k1 parameter - controls term frequency saturation Higher values give more weight to term frequency
DEFAULT_DENSE_RERANK_FACTOR
Default exact-rerank candidate multiplier for dense search.
DEFAULT_RRF_K
Default RRF rank constant (from Cormack et al., the standard choice).
MAX_CANDIDATE_OVERSUBSCRIPTION
Maximum candidate depth relative to the result window.
MAX_DENSE_NPROBE
Maximum number of IVF clusters a single dense query may probe.
MAX_DENSE_RERANK_FACTOR
Maximum exact-rerank candidate multiplier accepted by dense search.
MAX_FUSION_CANDIDATE_SLOTS
Maximum aggregate list slots retained before fusion.
MAX_FUSION_CHUNK_SLOTS
Maximum per-ordinal chunk contributions materialized during fusion.
MAX_FUSION_SUB_QUERIES
Maximum independently executed lists accepted by the Searcher fusion API.
MAX_QUERY_TERMS
Maximum number of query tokens (terms / dimensions) for text and sparse queries. Queries exceeding this limit are trimmed to the top-weighted terms.

Traits§

Collector
Trait for search result collectors
Query
A search query (async)
Scorer
Scored document stream: a DocSet that also provides scores.

Functions§

bm25_idf
Compute IDF (Inverse Document Frequency) using BM25 variant
bm25_score
Compute BM25 score for a term occurrence
bm25_upper_bound
Compute BM25 upper bound score for MaxScore pruning
bm25_upper_bound_with_len
BM25 upper bound with a known minimum length of the scoring units the bound covers (a block or a whole list): the shortest unit has the weakest length normalisation, so it bounds every longer one.
bm25f_score
Compute BM25F score with field boost
bm25f_upper_bound
Compute BM25F upper bound score for MaxScore pruning with field boost
collect_segment
Execute a query with one or more collectors (async)
collect_segment_with_limit
Execute a query with one or more collectors and a specific limit (async)
collect_segment_with_limit_seeded
Async collect_segment_with_limit with a cross-segment threshold seed.
collect_segment_with_limit_seeded_sync
Synchronous collect_segment_with_limit_sync with a cross-segment threshold seed (see collect_segment_with_limit_seeded).
collect_segment_with_limit_sync
Synchronous collect with limit — uses scorer_sync.
fuse_ranked_lists
Fuse multiple ranked result lists into a single top-limit list.
fuse_ranked_lists_chunked
Fuse multiple ranked result lists at chunk granularity.
max_candidate_limit
Largest default candidate pool for a requested result window.
rerank
Rerank L1 candidates by exact dense vector distance.
rrf_scores_for_hits
Compute RRF only for the selected hits, using ranks from complete lists. Input/output hit order is preserved. No retrieval, hydration or L1 scoring occurs here. Document context is broadcast to nominated passage scores.
search_segment_seeded
Per-segment search seeded with a cross-segment top-k floor (async).
search_segment_seeded_sync
Per-segment search seeded with a cross-segment top-k floor (sync).
search_segment_shared
Per-segment search with a live cross-segment top-k floor (async).
search_segment_shared_sync
Per-segment search with a live cross-segment top-k floor (sync).
search_segment_with_count
Execute a search query on a single segment and return (results, total_seen) (async)
search_segment_with_count_sync
Synchronous segment search — returns (results, total_seen).
search_segment_with_positions_and_count
Execute a search query on a single segment with positions and return (results, total_seen)
search_segment_with_positions_and_count_sync
Synchronous segment search with positions — returns (results, total_seen).
try_fuse_ranked_lists_chunked
Validated, bounded entry point for chunk-level fusion used by Searcher and the server. The legacy pure helper remains available for trusted embedded callers, while request-facing paths must account for ordinal expansion before allocating fusion maps.
try_fuse_ranked_lists_chunked_borrowed
Fuse borrowed nomination lists so diagnostics can reuse them without cloning documents or positions. Bounds and scoring match the owning entry point.

Type Aliases§

CountFuture
Future type for count estimation
DocPredicate
Per-document predicate closure type (platform-aware Send+Sync bounds)
MatchedPositions
Matched positions for a field (field_id, list of scored positions) Each position includes its individual score contribution
ScoreBatch
Exact scores corresponding to one compact posting batch.
ScoreBatchMask
ScorerFuture
Future type for scorer creation