Enum Operator

Source
#[non_exhaustive]
#[repr(u32)]
pub enum Operator {
Show 17 variants And = 0, Or, AndNot, XOr, AndMaybe, Filter, Near, Phrase, ValueRange, ScaleWeight, EliteSet, ValueGe, ValueLe, Synonym, Max, Wildcard, Invalid = 99,
}
Expand description

An Operator can be used to compose queries in novel ways

See upstream docs for details such as implications on document weighting, etc

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

And = 0

Only matches documents which match all subqueries

§

Or

Matches documents which match at least one subquery

§

AndNot

Matches documents which matches only the first subquery

§

XOr

Matches documents which match an odd number of subqueries

§

AndMaybe

Matches documents which match the first subquery, and takes extra weight from the remaining subqueries

§

Filter

Similar to [And], but weight is only taken from the first subquery (often used with boolean terms)

§

Near

Matches documents where all subqueries match and are near one another

§

Phrase

Matches documents where subqueries match, are near one another and in order

§

ValueRange

Matches documents with a value slot in the given range

§

ScaleWeight

Scales the weight contributed by a subquery

§

EliteSet

Picks the best N subqueries, and combines them with an [Or]

§

ValueGe

Matches documents with a value slot greater than or equal to the given value

§

ValueLe

Matches documents with a value slot less than or equal to the given value

§

Synonym

Matches documents which match any of the subqueries, but weights them as if they were a single term

§

Max

Sets the maximum weight of any subquery

§

Wildcard

Enables wildcard expansion on subqueries

§

Invalid = 99

Represents an invalid query

Trait Implementations§

Source§

impl PartialEq for Operator

Source§

fn eq(&self, other: &Operator) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Operator

Auto Trait Implementations§

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> 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, 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.