Enum elasticsearch_dsl::search::queries::Query [−][src]
pub enum Query {
Show 35 variants
Bool(Box<BoolQuery>),
Prefix(Box<PrefixQuery>),
Regexp(Box<RegexpQuery>),
Wildcard(Box<WildcardQuery>),
TermsSet(Box<TermsSetQuery>),
Term(Box<TermQuery>),
TermsValues(Box<TermsQuery<BTreeSet<Scalar>>>),
TermsLookup(Box<TermsQuery<TermsLookup>>),
Exists(Box<ExistsQuery>),
Range(Box<RangeQuery>),
Ids(Box<IdsQuery>),
ConstantScore(Box<ConstantScoreQuery>),
DistanceFeatureDate(Box<DistanceFeatureQuery<DateTime<Utc>>>),
DistanceFeatureGeo(Box<DistanceFeatureQuery<GeoPoint>>),
Match(Box<MatchQuery>),
MatchBoolPrefix(Box<MatchBoolPrefixQuery>),
MatchPhrasePrefix(Box<MatchPhrasePrefixQuery>),
MatchAll(Box<MatchAllQuery>),
MatchNone(Box<MatchNoneQuery>),
MatchPhrase(Box<MatchPhraseQuery>),
MultiMatch(Box<MultiMatchQuery>),
Nested(Box<NestedQuery>),
Boosting(Box<BoostingQuery>),
DisMax(Box<DisMaxQuery>),
PercolateDocument(Box<PercolateQuery<Value>>),
PercolateDocuments(Box<PercolateQuery<Vec<Value>>>),
PercolateLookup(Box<PercolateQuery<PercolateLookup>>),
FunctionScore(Box<FunctionScoreQuery>),
RankFeature(Box<RankFeatureQuery>),
RankFeatureSaturation(Box<RankFeatureSaturationQuery>),
RankFeatureLogarithm(Box<RankFeatureLogarithmQuery>),
RankFeatureSigmoid(Box<RankFeatureSigmoidQuery>),
RankFeatureLinear(Box<RankFeatureLinearQuery>),
MoreLikeThis(Box<MoreLikeThisQuery>),
Fuzzy(Box<FuzzyQuery>),
}Expand description
A container enum for supported Elasticsearch query types
Variants
Prefix(Box<PrefixQuery>)Tuple Fields of Prefix
0: Box<PrefixQuery>Regexp(Box<RegexpQuery>)Tuple Fields of Regexp
0: Box<RegexpQuery>Wildcard(Box<WildcardQuery>)Tuple Fields of Wildcard
0: Box<WildcardQuery>TermsSet(Box<TermsSetQuery>)Tuple Fields of TermsSet
0: Box<TermsSetQuery>TermsValues(Box<TermsQuery<BTreeSet<Scalar>>>)Tuple Fields of TermsValues
0: Box<TermsQuery<BTreeSet<Scalar>>>TermsLookup(Box<TermsQuery<TermsLookup>>)Tuple Fields of TermsLookup
0: Box<TermsQuery<TermsLookup>>Exists(Box<ExistsQuery>)Tuple Fields of Exists
0: Box<ExistsQuery>Range(Box<RangeQuery>)Tuple Fields of Range
0: Box<RangeQuery>ConstantScore(Box<ConstantScoreQuery>)Tuple Fields of ConstantScore
DistanceFeatureDate(Box<DistanceFeatureQuery<DateTime<Utc>>>)Tuple Fields of DistanceFeatureDate
0: Box<DistanceFeatureQuery<DateTime<Utc>>>DistanceFeatureGeo(Box<DistanceFeatureQuery<GeoPoint>>)Tuple Fields of DistanceFeatureGeo
Match(Box<MatchQuery>)Tuple Fields of Match
0: Box<MatchQuery>MatchBoolPrefix(Box<MatchBoolPrefixQuery>)Tuple Fields of MatchBoolPrefix
MatchPhrasePrefix(Box<MatchPhrasePrefixQuery>)Tuple Fields of MatchPhrasePrefix
MatchAll(Box<MatchAllQuery>)Tuple Fields of MatchAll
0: Box<MatchAllQuery>MatchNone(Box<MatchNoneQuery>)Tuple Fields of MatchNone
0: Box<MatchNoneQuery>MatchPhrase(Box<MatchPhraseQuery>)Tuple Fields of MatchPhrase
0: Box<MatchPhraseQuery>MultiMatch(Box<MultiMatchQuery>)Tuple Fields of MultiMatch
0: Box<MultiMatchQuery>Nested(Box<NestedQuery>)Tuple Fields of Nested
0: Box<NestedQuery>Boosting(Box<BoostingQuery>)Tuple Fields of Boosting
0: Box<BoostingQuery>DisMax(Box<DisMaxQuery>)Tuple Fields of DisMax
0: Box<DisMaxQuery>PercolateDocument(Box<PercolateQuery<Value>>)Tuple Fields of PercolateDocument
0: Box<PercolateQuery<Value>>PercolateDocuments(Box<PercolateQuery<Vec<Value>>>)Tuple Fields of PercolateDocuments
0: Box<PercolateQuery<Vec<Value>>>PercolateLookup(Box<PercolateQuery<PercolateLookup>>)Tuple Fields of PercolateLookup
FunctionScore(Box<FunctionScoreQuery>)Tuple Fields of FunctionScore
RankFeature(Box<RankFeatureQuery>)Tuple Fields of RankFeature
0: Box<RankFeatureQuery>RankFeatureSaturation(Box<RankFeatureSaturationQuery>)Tuple Fields of RankFeatureSaturation
RankFeatureLogarithm(Box<RankFeatureLogarithmQuery>)Tuple Fields of RankFeatureLogarithm
RankFeatureSigmoid(Box<RankFeatureSigmoidQuery>)Tuple Fields of RankFeatureSigmoid
RankFeatureLinear(Box<RankFeatureLinearQuery>)Tuple Fields of RankFeatureLinear
MoreLikeThis(Box<MoreLikeThisQuery>)Tuple Fields of MoreLikeThis
0: Box<MoreLikeThisQuery>Fuzzy(Box<FuzzyQuery>)Tuple Fields of Fuzzy
0: Box<FuzzyQuery>Implementations
pub fn boosting<Q, B>(
positive: Q,
negative: Q,
negative_boost: B
) -> BoostingQuery where
Q: Into<Query>,
B: Into<NegativeBoost>,
pub fn boosting<Q, B>(
positive: Q,
negative: Q,
negative_boost: B
) -> BoostingQuery where
Q: Into<Query>,
B: Into<NegativeBoost>,
Creates an instance of BoostingQuery
positive- Query you wish to run. Any returned documents must match this query.negative- Query used to decrease the relevance score of matching documents.
If a returned document matches thepositivequery and this query, theboostingquery calculates the final relevance score for the document as follows:- Take the original relevance score from the
positivequery. - Multiply the score by the
negative_boostvalue.
- Take the original relevance score from the
negative_boost- Floating point number between0and1.0used to decrease the relevance scores of documents matching thenegativequery.
Creates an instance of ConstantScoreQuery
filter- Filter query you wish to run. Any returned documents must match this query.
Filter queries do not calculate relevance scores. To speed up performance, Elasticsearch automatically caches frequently used filter queries.
Creates an instance of DisMaxQuery
Creates an instance of FunctionScoreQuery
pub fn match_bool_prefix(
field: impl Into<String>,
query: impl Into<String>
) -> MatchBoolPrefixQuery
pub fn match_bool_prefix(
field: impl Into<String>,
query: impl Into<String>
) -> MatchBoolPrefixQuery
Creates an instance of MatchBoolPrefixQuery
field- Field you wish to search.query- Text, number, boolean value or date you wish to find in the provided<field>
pub fn match_phrase_prefix(
field: impl Into<String>,
query: impl Into<String>
) -> MatchPhrasePrefixQuery
pub fn match_phrase_prefix(
field: impl Into<String>,
query: impl Into<String>
) -> MatchPhrasePrefixQuery
Creates an instance of MatchPhrasePrefixQuery
field- Field you wish to search.query- Text you wish to find in the provided.
Thematch_phrase_prefixquery analyzes any provided text into tokens before performing a search. The last term of this text is treated as a prefix, matching any words that begin with that term.
Creates an instance of MatchPhraseQuery
field- Field you wish to search.query- Text, number, boolean value or date you wish to find in the provided<field>.
Thematch_phrasequery analyzes any provided text before performing a search. This means thematch_phrasequery can searchtextfields for analyzed tokens rather than an exact term.
Creates an instance of MatchQuery
pub fn multi_match<F, S>(fields: F, query: S) -> MultiMatchQuery where
F: IntoIterator,
F::Item: ToString,
S: Into<String>,
pub fn multi_match<F, S>(fields: F, query: S) -> MultiMatchQuery where
F: IntoIterator,
F::Item: ToString,
S: Into<String>,
Creates an instance of MultiMatchQuery
Creates an instance of NestedQuery
path- Path to the nested object you wish to search.query- Query you wish to run on nested objects in thepath. If an object matches the search, thenestedquery returns the root parent document.
You can search nested fields using dot notation that includes the complete path, such asobj1.name.
Multi-level nesting is automatically supported, and detected, resulting in an inner nested query to automatically match the relevant nesting level, rather than root, if it exists within another nested query.
Multi-level nested queries are also supported.
pub fn distance_feature<O: Origin>(
field: impl Into<String>,
origin: O,
pivot: <O as Origin>::Pivot
) -> DistanceFeatureQuery<O>
pub fn distance_feature<O: Origin>(
field: impl Into<String>,
origin: O,
pivot: <O as Origin>::Pivot
) -> DistanceFeatureQuery<O>
Creates an instance of DistanceFeatureQuery
field- Name of the field used to calculate distances. This field must meet the following criteria:
- Be a
date,date_nanosorgeo_pointfield - Have an index
mapping parameter value of
true, which is the default - Have an
doc_valuesmapping parameter value oftrue, which is the default
- Be a
origin- Date or point of origin used to calculate distances.
If thefieldvalue is adateordate_nanosfield, theoriginvalue must be a date. Date Math, such asnow-1h, is supported.
If thefieldvalue is ageo_pointfield, theoriginvalue must be a geopoint.pivot- Distance from theoriginat which relevance scores receive half of the boost value.
If the field value is adateordate_nanosfield, thepivotvalue must be atime unit, such as1hor10d.
If thefieldvalue is ageo_pointfield, thepivotvalue must be a distance unit , such as1kmor12m.
pub fn more_like_this<I>(like: I) -> MoreLikeThisQuery where
I: IntoIterator,
I::Item: Into<Like>,
pub fn more_like_this<I>(like: I) -> MoreLikeThisQuery where
I: IntoIterator,
I::Item: Into<Like>,
Creates an instance of MoreLikeThisQuery
like- free form text and/or a single or multiple documents.
pub fn percolate<T: PercolateMarker>(
field: impl Into<String>,
source: T
) -> PercolateQuery<T>
pub fn percolate<T: PercolateMarker>(
field: impl Into<String>,
source: T
) -> PercolateQuery<T>
Creates an instance of PercolateQuery
field- The field of typepercolatorthat holds the indexed queriessource- Source to percolate
pub fn percolate_lookup<S>(
field: S,
index: S,
id: S
) -> PercolateQuery<PercolateLookup> where
S: Into<String>,
pub fn percolate_lookup<S>(
field: S,
index: S,
id: S
) -> PercolateQuery<PercolateLookup> where
S: Into<String>,
Creates an instance of PercolateQuery
field- The field of typepercolatorthat holds the indexed queriesindex- The index the document resides inid- The id of the document to fetch
Creates an instance of RankFeatureQuery
field-rank_featureorrank_featuresfield used to boost relevance scores
Creates an instance of ExistsQuery
field- Name of the field you wish to search. While a field is deemed non-existent if the JSON value isnullor[], these values will indicate the field does exist:- Empty strings, such as
""or"-" - Arrays containing
nulland another value, such as[null, "foo"] - A custom
null-value, defined in field mapping
- Empty strings, such as
Creates an instance of FuzzyQuery
field- Field you wish to search.value- Fuzzy you wish to find in the provided field.
Creates an instance of IdsQuery
values- An array of document IDs.
Creates an instance of PrefixQuery
field- Field you wish to search.value- Term you wish to find in the provided field. To return a document, the term must exactly match the field value, including whitespace and capitalization.
Creates an instance of RangeQuery
field- Field you wish to search.
Creates an instance of RegexpQuery
field- Field you wish to search.value- Regular expression for terms you wish to find in the provided field. For a list of supported operators, see Regular expression syntax.
By default, regular expressions are limited to 1,000 characters. You can change this limit
using the
index.max_regex_length setting.
Creates an instance of TermQuery
field- Field you wish to search.value- Term you wish to find in the provided field. To return a document, the term must exactly match the field value, including whitespace and capitalization.
Creates an instance of TermsQuery
field- Field you wish to search.values- An array of terms you wish to find in the provided field. To return a document, one or more terms must exactly match a field value, including whitespace and capitalization.
By default, Elasticsearch limits thetermsquery to a maximum of 65,536 terms. You can change this limit using theindex.max_terms_count setting.
To use the field values of an existing document as search terms, use the terms lookup parameters.
pub fn terms_lookup<S: Into<String>>(
field: S,
index: S,
id: S,
path: S
) -> TermsQuery<TermsLookup>
pub fn terms_lookup<S: Into<String>>(
field: S,
index: S,
id: S,
path: S
) -> TermsQuery<TermsLookup>
Creates an instance of TermsQuery
field- Field you wish to search.index- Name of the index from which to fetch field values.id- ID of the document from which to fetch field values.path- Name of the field from which to fetch field values. Elasticsearch uses these values as search terms for the query. If the field values include an array of nested inner objects, you can access those objects using dot notation syntax.
pub fn terms_set<I>(
field: impl Into<String>,
terms: I,
minimum_should_match: impl Into<TermsSetMinimumShouldMatch>
) -> TermsSetQuery where
I: IntoIterator,
I::Item: Into<Scalar>,
pub fn terms_set<I>(
field: impl Into<String>,
terms: I,
minimum_should_match: impl Into<TermsSetMinimumShouldMatch>
) -> TermsSetQuery where
I: IntoIterator,
I::Item: Into<Scalar>,
Creates an instance of TermsSetQuery
field- Field you wish to search.value- TermsSet you wish to find in the provided field. To return a document, the terms_set must exactly match the field value, including whitespace and capitalization.
Creates an instance of WildcardQuery
field- Field you wish to search.value- Wildcard you wish to find in the provided field. To return a document, the wildcard must exactly match the field value, including whitespace and capitalization.
Creates an instance of MatchAllQuery
Creates an instance of MatchNoneQuery
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Query
impl UnwindSafe for Query
Blanket Implementations
Mutably borrows from an owned value. Read more