pub struct Query<S = Root> { /* private fields */ }Expand description
A composable query clause in scope S.
Handles produce a Query<S> (User::email().eq(…) → Query<Root>,
Order::status().eq(…) → Query<Order>). and/or/not and the
crate::Search clauses only combine the same scope; a nested query is
lifted to its parent scope through the nested handle.
Implementations§
Source§impl<S> Query<S>
impl<S> Query<S>
Sourcepub fn boost(self, boost: f32) -> Query<S>
pub fn boost(self, boost: f32) -> Query<S>
Set boost on this clause. On a bool (an and/or/not result) it
becomes the bool’s boost; a leaf clause is wrapped in a bool whose
single must is the leaf (prefer the leaf builder’s own boost there).
Sourcepub fn min_should_match(self, value: impl Into<MinimumShouldMatch>) -> Query<S>
pub fn min_should_match(self, value: impl Into<MinimumShouldMatch>) -> Query<S>
Set minimum_should_match on a should-group. Use this on an or
chain (or Search::min_should_match) so the optional clauses become a
real constraint — without it, should beside must/filter only
scores. Accepts a count (1) or MinimumShouldMatch::percent / raw.
A leaf clause is wrapped as a single should.
Trait Implementations§
Source§impl<S> AsQuery<S> for Query<S>
impl<S> AsQuery<S> for Query<S>
Source§fn into_query(self) -> Option<Query<S>>
fn into_query(self) -> Option<Query<S>>
None to contribute nothing.Source§fn and(self, other: impl AsQuery<S>) -> Query<S>where
Self: Sized,
fn and(self, other: impl AsQuery<S>) -> Query<S>where
Self: Sized,
self AND other. An absent side is the identity.Source§fn or(self, other: impl AsQuery<S>) -> Query<S>where
Self: Sized,
fn or(self, other: impl AsQuery<S>) -> Query<S>where
Self: Sized,
self OR other. An absent side is the identity.