Skip to main content

summa_core/query/
mod.rs

1//! Query types and search execution
2
3/// Maximum number of query tokens (terms / dimensions) for text and sparse queries.
4/// Queries exceeding this limit are trimmed to the top-weighted terms.
5pub const MAX_QUERY_TERMS: usize = 64;
6
7/// Maximum candidate depth relative to the result window.
8///
9/// This is the single query-level oversubscription policy used by fusion,
10/// vector reranking, and request-facing adapters. A caller that already asks
11/// for an expanded result window may explicitly use that window as its
12/// candidate depth; no layer multiplies an explicit depth again.
13pub const MAX_CANDIDATE_OVERSUBSCRIPTION: usize = 2;
14
15/// Largest default candidate pool for a requested result window.
16pub const fn max_candidate_limit(result_window: usize) -> usize {
17    result_window.saturating_mul(MAX_CANDIDATE_OVERSUBSCRIPTION)
18}
19
20mod all;
21mod bm25;
22pub(crate) mod bmp;
23pub(crate) use planner::bmp_executor_limit;
24mod boolean;
25mod boost;
26pub mod candidate_scoring;
27mod collector;
28pub mod docset;
29mod filtered;
30mod fusion;
31pub use filtered::FilteredQuery;
32mod global_stats;
33mod phrase;
34mod planner;
35mod prefix;
36mod proximity;
37mod range;
38mod regex;
39mod required_text;
40mod reranker;
41mod scoring;
42#[cfg(test)]
43mod scoring_tests;
44pub(crate) mod seismic;
45mod term;
46mod term_pattern;
47mod term_union;
48mod text_mapping;
49mod traits;
50mod vector;
51mod wildcard;
52
53pub use all::AllQuery;
54pub use bm25::*;
55pub use boolean::*;
56pub use boost::*;
57pub use collector::*;
58pub use docset::*;
59pub use fusion::*;
60pub use global_stats::*;
61pub use phrase::*;
62pub use prefix::*;
63pub use proximity::ProximityConfig;
64pub use range::*;
65pub use regex::RegexQuery;
66pub use reranker::*;
67pub use scoring::*;
68pub use term::*;
69pub use traits::*;
70pub use vector::*;
71pub use wildcard::WildcardQuery;
72
73pub use candidate_scoring::{
74    CandidateFeature, CandidateQuery, CandidateScores, CandidateScoringPlan, PassageFeatures,
75    RankingModel, ScoreScope, ScoredCandidate,
76};