pub struct MapSearch<S = Root> { /* private fields */ }Expand description
A cross-key full-text query over a TextMap: one analyzed query matched
against every key, with optional per-key preference. Renders a multi_match
of type: best_fields over the preferred keys (each field^weight) plus the
wildcard path.* fallback, so the best-scoring key wins without
double-counting. only_preferred drops the fallback.
Implementations§
Source§impl<S> MapSearch<S>
impl<S> MapSearch<S>
Sourcepub fn prefer(self, key: impl AsRef<str>, weight: f32) -> Self
pub fn prefer(self, key: impl AsRef<str>, weight: f32) -> Self
Prefer a key, weighting its score by weight (path.key^weight). Add
several to rank keys (e.g. the user’s locale highest).
Sourcepub fn only_preferred(self) -> Self
pub fn only_preferred(self) -> Self
Search only the preferred keys — drop the path.* fallback that
otherwise also searches every other key.
Sourcepub fn operator(self, operator: Operator) -> Self
pub fn operator(self, operator: Operator) -> Self
Combine analyzed terms with Operator::And or Operator::Or
(default Or).
Sourcepub fn fuzziness(self, fuzziness: Fuzziness) -> Self
pub fn fuzziness(self, fuzziness: Fuzziness) -> Self
Edit distance for analyzed terms (Fuzziness::Auto is the usual choice).
Sourcepub fn minimum_should_match(self, value: impl Into<MinimumShouldMatch>) -> Self
pub fn minimum_should_match(self, value: impl Into<MinimumShouldMatch>) -> Self
How many of the analyzed terms must match
(e.g. 2, MinimumShouldMatch::percent(75)).
Trait Implementations§
Source§impl<S> AsQuery<S> for MapSearch<S>
impl<S> AsQuery<S> for MapSearch<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.