pub struct QueryOpts<'a> {
pub stats: Option<&'a CorpusStats>,
pub typo: u32,
pub fields: &'a [usize],
pub filter: &'a [Filter<'a>],
pub sort: Option<Sort<'a>>,
pub distinct: Option<Distinct<'a>>,
}Expand description
Everything a MATCH query carries beyond its text and result limit.
Grouping them keeps the query entry point from growing a parameter per
clause, and gives every clause one place to be defaulted from
(QueryOpts::default is the plain, exact, unscoped query).
Fields§
§stats: Option<&'a CorpusStats>Corpus-wide BM25 statistics — the second pass of a cross-shard
query. None scores against this segment’s own slice.
typo: u32Edit distance allowed on bare terms (TYPO n); 0 = exact.
fields: &'a [usize]Field positions the query is restricted to (IN <field…>); empty
= every field.
filter: &'a [Filter<'a>]FILTER: non-scoring predicates, ANDed. Applied before the top-K
— filtering afterwards would return fewer hits than exist.
sort: Option<Sort<'a>>SORT: select by a stored value instead of by score. Selecting,
not re-ordering: a document that wins on the sort key must be
chosen even when its score would never have reached the page.
distinct: Option<Distinct<'a>>DISTINCT: at most one hit per value of a stored field. Applied
during selection, so the page is filled with limit DISTINCT
documents rather than limit documents that then collapse.