Skip to main content

MatchOpts

Struct MatchOpts 

Source
pub struct MatchOpts<'a> {
    pub highlight: Option<&'a [Vec<u8>]>,
    pub typo: u32,
    pub offset: usize,
    pub scope: &'a [Vec<u8>],
    pub filters: &'a [ValueFilter<'a>],
    pub sort: Option<(&'a [u8], bool)>,
    pub distinct: Option<&'a [u8]>,
    pub facets: &'a [Vec<u8>],
}
Expand description

Everything a text MATCH carries beyond its index, query text and result limit — the embedded twin of the wire’s optional clauses.

Grouping them keeps one entry point instead of one per clause, and MatchOpts::default is the plain query, so a caller opts into exactly the clauses it names.

Fields§

§highlight: Option<&'a [Vec<u8>]>

HIGHLIGHT: None = not requested, Some(&[]) = every indexed field, Some(names) = only those.

§typo: u32

TYPO n: edit budget for each bare term; 0 = exact.

§offset: usize

OFFSET n: hits to skip before limit takes effect.

§scope: &'a [Vec<u8>]

IN <field…>: the declared field names to score within; empty = the whole document.

§filters: &'a [ValueFilter<'a>]

FILTER …: non-scoring predicates over stored values, ANDed. They decide which documents are eligible, not what a term is worth, so the corpus statistics stay whole-corpus.

§sort: Option<(&'a [u8], bool)>

SORT <field> ASC|DESC: select by a stored value instead of by score. Selecting, not re-ordering — a document that wins on the key is chosen even when its score would never have reached the page.

§distinct: Option<&'a [u8]>

DISTINCT <field>: at most one hit per value of a stored field, applied during selection so the page holds limit distinct documents rather than limit that then collapse.

§facets: &'a [Vec<u8>]

FACET <field…>: count each field’s values over the whole match set. Reported alongside the page rather than shaping it.

Trait Implementations§

Source§

impl<'a> Clone for MatchOpts<'a>

Source§

fn clone(&self) -> MatchOpts<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for MatchOpts<'a>

Source§

impl<'a> Default for MatchOpts<'a>

Source§

fn default() -> MatchOpts<'a>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for MatchOpts<'a>

§

impl<'a> RefUnwindSafe for MatchOpts<'a>

§

impl<'a> Send for MatchOpts<'a>

§

impl<'a> Sync for MatchOpts<'a>

§

impl<'a> Unpin for MatchOpts<'a>

§

impl<'a> UnsafeUnpin for MatchOpts<'a>

§

impl<'a> UnwindSafe for MatchOpts<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.