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.
- Binary
Dense Vector Query - Binary dense vector query for Hamming distance similarity search
- Bm25
Params - Per-field BM25 parameters (
indexed<k1: ..., b: ...>in the schema). - Boolean
Query - Boolean query with MUST, SHOULD, and MUST_NOT clauses
- Boost
Query - Boost query - multiplies the score of the inner query
- Count
Collector - Collector that counts all matching documents
- Dense
Vector Query - 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.
- Empty
Scorer - Empty scorer for terms that don’t exist
- Filtered
Query - Global
Stats - Global statistics aggregated across all segments (legacy)
- Global
Stats Builder - Builder for aggregating statistics from multiple segments
- Global
Stats Cache - Cached global statistics with automatic invalidation
- Heap
Entry - Entry for top-k min-heap
- Lazy
Global Stats - Lazy global statistics bound to a fixed set of segments
- Matched
Field - Matched field info with ordinals (for multi-valued fields)
- MaxScore
Executor - Unified Block-Max MaxScore executor for top-k retrieval
- Phrase
Query - Phrase query - matches documents containing terms in consecutive positions
- Prefix
Query - Prefix query — matches documents containing any term starting with
prefix. - Proximity
Config - Proximity rescoring of a text query (
MatchQuery.proximity_weight). - Range
Query - Fast-field range query.
- Regex
Query - Constant-score union of indexed terms matching a whole regular expression.
- Reranker
Config - Configuration for L2 dense/binary vector reranking
- RrfContribution
- One vote from a branch’s complete nomination list, before backfill.
- RrfRanked
List - A nomination branch. None scope preserves legacy chunk fusion semantics.
- RrfScore
- Score
Collector - Efficient top-k collector using min-heap (internal, scoring-layer)
- Scored
Doc - Search result from MaxScore execution
- Scored
Position - 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)
- Scorer
Options - Options that affect scorer construction rather than scoring semantics.
- Search
Hit - Search hit with unique document address and score
- Search
Response - Search response with hits (IDs only, no documents)
- Search
Result - Search result with doc_id and score (internal use)
- Shared
Threshold - Cross-segment top-k score floor, shared across the parallel/concurrent per-segment searches of a single query.
- Sparse
Field Stats - Statistics for a sparse vector field
- Sparse
Term Query - Query for a single sparse vector dimension.
- Sparse
Term Query Info - Info for MaxScore-optimizable sparse term queries
- Sparse
Vector Query - Sparse vector query for similarity search
- Term
Query - Term query - matches documents containing a specific term
- Term
Query Info - Info for MaxScore-optimizable term queries
- Text
Field Stats - Statistics for a full-text field
- TopK
Collector - Collector for top-k results
- Wildcard
Query - Constant-score union of indexed terms matching a whole-term wildcard.
Enums§
- Fusion
Method - Method for fusing multiple ranked result lists.
- Length
Source - 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,
tfstands in for the length. - Multi
Value Combiner - Strategy for combining scores when a document has multiple values for the same field
- Query
Decomposition - Decomposition of a query for MaxScore optimization.
- Range
Bound - 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_limitwith a cross-segment threshold seed. - collect_
segment_ with_ limit_ seeded_ sync - Synchronous
collect_segment_with_limit_syncwith a cross-segment threshold seed (seecollect_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-
limitlist. - 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§
- Count
Future - Future type for count estimation
- DocPredicate
- Per-document predicate closure type (platform-aware Send+Sync bounds)
- Matched
Positions - Matched positions for a field (field_id, list of scored positions) Each position includes its individual score contribution
- Score
Batch - Exact scores corresponding to one compact posting batch.
- Score
Batch Mask - Scorer
Future - Future type for scorer creation