Enum elasticsearch_dsl::search::queries::Query
source · pub enum Query {
Show 60 variants
Bool(BoolQuery),
Prefix(PrefixQuery),
Regexp(RegexpQuery),
Wildcard(WildcardQuery),
TermsSet(TermsSetQuery),
Term(TermQuery),
Terms(TermsQuery),
TermsLookup(TermsLookupQuery),
Exists(ExistsQuery),
Range(RangeQuery),
Ids(IdsQuery),
ConstantScore(ConstantScoreQuery),
DistanceFeatureDate(DistanceFeatureQuery<DateTime<Utc>>),
DistanceFeatureGeo(DistanceFeatureQuery<GeoLocation>),
Match(MatchQuery),
MatchBoolPrefix(MatchBoolPrefixQuery),
MatchPhrasePrefix(MatchPhrasePrefixQuery),
MatchAll(MatchAllQuery),
MatchNone(MatchNoneQuery),
MatchPhrase(MatchPhraseQuery),
MultiMatch(MultiMatchQuery),
Nested(NestedQuery),
Boosting(BoostingQuery),
DisMax(DisMaxQuery),
Pinned(PinnedQuery),
Percolate(PercolateQuery),
PercolateLookup(PercolateLookupQuery),
FunctionScore(FunctionScoreQuery),
RankFeature(RankFeatureQuery),
RankFeatureSaturation(RankFeatureSaturationQuery),
RankFeatureLogarithm(RankFeatureLogarithmQuery),
RankFeatureSigmoid(RankFeatureSigmoidQuery),
RankFeatureLinear(RankFeatureLinearQuery),
MoreLikeThis(MoreLikeThisQuery),
Fuzzy(FuzzyQuery),
GeoDistance(GeoDistanceQuery),
GeoBoundingBox(GeoBoundingBoxQuery),
GeoShapeLookup(GeoShapeLookupQuery),
GeoShape(GeoShapeQuery),
ShapeLookup(ShapeLookupQuery),
Shape(ShapeQuery),
Json(JsonQuery),
Wrapper(WrapperQuery),
Script(ScriptQuery),
ScriptScore(ScriptScoreQuery),
ParentId(ParentIdQuery),
HasParent(HasParentQuery),
HasChild(HasChildQuery),
SimpleQueryString(SimpleQueryStringQuery),
QueryString(QueryStringQuery),
CombinedFields(CombinedFieldsQuery),
SpanContaining(SpanContainingQuery),
SpanFieldMasking(SpanFieldMaskingQuery),
SpanFirst(SpanFirstQuery),
SpanMulti(SpanMultiQuery),
SpanNear(SpanNearQuery),
SpanNot(SpanNotQuery),
SpanOr(SpanOrQuery),
SpanTerm(SpanTermQuery),
SpanWithin(SpanWithinQuery),
}
Expand description
A container enum for supported Elasticsearch query types
Variants§
Bool(BoolQuery)
Prefix(PrefixQuery)
Regexp(RegexpQuery)
Wildcard(WildcardQuery)
TermsSet(TermsSetQuery)
Term(TermQuery)
Terms(TermsQuery)
TermsLookup(TermsLookupQuery)
Exists(ExistsQuery)
Range(RangeQuery)
Ids(IdsQuery)
ConstantScore(ConstantScoreQuery)
DistanceFeatureDate(DistanceFeatureQuery<DateTime<Utc>>)
DistanceFeatureGeo(DistanceFeatureQuery<GeoLocation>)
Match(MatchQuery)
MatchBoolPrefix(MatchBoolPrefixQuery)
MatchPhrasePrefix(MatchPhrasePrefixQuery)
MatchAll(MatchAllQuery)
MatchNone(MatchNoneQuery)
MatchPhrase(MatchPhraseQuery)
MultiMatch(MultiMatchQuery)
Nested(NestedQuery)
Boosting(BoostingQuery)
DisMax(DisMaxQuery)
Pinned(PinnedQuery)
Percolate(PercolateQuery)
PercolateLookup(PercolateLookupQuery)
FunctionScore(FunctionScoreQuery)
RankFeature(RankFeatureQuery)
RankFeatureSaturation(RankFeatureSaturationQuery)
RankFeatureLogarithm(RankFeatureLogarithmQuery)
RankFeatureSigmoid(RankFeatureSigmoidQuery)
RankFeatureLinear(RankFeatureLinearQuery)
MoreLikeThis(MoreLikeThisQuery)
Fuzzy(FuzzyQuery)
GeoDistance(GeoDistanceQuery)
GeoBoundingBox(GeoBoundingBoxQuery)
GeoShapeLookup(GeoShapeLookupQuery)
GeoShape(GeoShapeQuery)
ShapeLookup(ShapeLookupQuery)
Shape(ShapeQuery)
Json(JsonQuery)
Wrapper(WrapperQuery)
Script(ScriptQuery)
ScriptScore(ScriptScoreQuery)
ParentId(ParentIdQuery)
HasParent(HasParentQuery)
HasChild(HasChildQuery)
SimpleQueryString(SimpleQueryStringQuery)
QueryString(QueryStringQuery)
CombinedFields(CombinedFieldsQuery)
SpanContaining(SpanContainingQuery)
SpanFieldMasking(SpanFieldMaskingQuery)
SpanFirst(SpanFirstQuery)
SpanMulti(SpanMultiQuery)
SpanNear(SpanNearQuery)
SpanNot(SpanNotQuery)
SpanOr(SpanOrQuery)
SpanTerm(SpanTermQuery)
SpanWithin(SpanWithinQuery)
Implementations§
source§impl Query
impl Query
sourcepub fn boosting<Q, B>(
positive: Q,
negative: Q,
negative_boost: B
) -> BoostingQuerywhere
Q: Into<Query>,
B: Into<NegativeBoost>,
pub fn boosting<Q, B>(
positive: Q,
negative: Q,
negative_boost: B
) -> BoostingQuerywhere
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 thepositive
query and this query, theboosting
query calculates the final relevance score for the document as follows:- Take the original relevance score from the
positive
query. - Multiply the score by the
negative_boost
value.
- Take the original relevance score from the
negative_boost
- Floating point number between0
and1.0
used to decrease the relevance scores of documents matching thenegative
query.
source§impl Query
impl Query
sourcepub fn constant_score<T>(filter: T) -> ConstantScoreQuerywhere
T: Into<Query>,
pub fn constant_score<T>(filter: T) -> ConstantScoreQuerywhere
T: Into<Query>,
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.
source§impl Query
impl Query
sourcepub fn dis_max() -> DisMaxQuery
pub fn dis_max() -> DisMaxQuery
Creates an instance of DisMaxQuery
source§impl Query
impl Query
sourcepub fn function_score<T>(query: T) -> FunctionScoreQuerywhere
T: Into<Query>,
pub fn function_score<T>(query: T) -> FunctionScoreQuerywhere
T: Into<Query>,
Creates an instance of FunctionScoreQuery
source§impl Query
impl Query
sourcepub fn combined_fields<F, S>(fields: F, query: S) -> CombinedFieldsQuerywhere
F: IntoIterator,
F::Item: ToString,
S: Into<Text>,
pub fn combined_fields<F, S>(fields: F, query: S) -> CombinedFieldsQuerywhere
F: IntoIterator,
F::Item: ToString,
S: Into<Text>,
Creates an instance of CombinedFieldsQuery
fields
- List of fields to search. Field wildcard patterns are allowed. Only text fields are supported, and they must all have the same search analyzer.query
- Text to search for in the provided<fields>
. The combined_fields query analyzes the provided text before performing a search.
source§impl Query
impl Query
sourcepub fn match_bool_prefix<T, U>(field: T, query: U) -> MatchBoolPrefixQuerywhere
T: ToString,
U: Into<Text>,
pub fn match_bool_prefix<T, U>(field: T, query: U) -> MatchBoolPrefixQuerywhere
T: ToString,
U: Into<Text>,
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>
source§impl Query
impl Query
sourcepub fn match_phrase_prefix<T, U>(field: T, query: U) -> MatchPhrasePrefixQuerywhere
T: ToString,
U: Into<Text>,
pub fn match_phrase_prefix<T, U>(field: T, query: U) -> MatchPhrasePrefixQuerywhere
T: ToString,
U: Into<Text>,
Creates an instance of MatchPhrasePrefixQuery
field
- Field you wish to search.query
- Text you wish to find in the provided.
Thematch_phrase_prefix
query 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.
source§impl Query
impl Query
sourcepub fn match_phrase<T, U>(field: T, query: U) -> MatchPhraseQuerywhere
T: ToString,
U: Into<Text>,
pub fn match_phrase<T, U>(field: T, query: U) -> MatchPhraseQuerywhere
T: ToString,
U: Into<Text>,
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_phrase
query analyzes any provided text before performing a search. This means thematch_phrase
query can searchtext
fields for analyzed tokens rather than an exact term.
source§impl Query
impl Query
sourcepub fn match<T, U>(field: T, query: U) -> MatchQuerywhere
T: ToString,
U: Into<Text>,
pub fn match<T, U>(field: T, query: U) -> MatchQuerywhere
T: ToString,
U: Into<Text>,
Creates an instance of MatchQuery
source§impl Query
impl Query
sourcepub fn multi_match<F, S>(fields: F, query: S) -> MultiMatchQuerywhere
F: IntoIterator,
F::Item: ToString,
S: Into<Text>,
pub fn multi_match<F, S>(fields: F, query: S) -> MultiMatchQuerywhere
F: IntoIterator,
F::Item: ToString,
S: Into<Text>,
Creates an instance of MultiMatchQuery
source§impl Query
impl Query
sourcepub fn query_string<S>(query: S) -> QueryStringQuerywhere
S: Into<Text>,
pub fn query_string<S>(query: S) -> QueryStringQuerywhere
S: Into<Text>,
Creates an instance of QueryStringQuery
query
- Query string you wish to parse and use for search. See Simple query string syntax.
source§impl Query
impl Query
sourcepub fn simple_query_string<S>(query: S) -> SimpleQueryStringQuerywhere
S: Into<Text>,
pub fn simple_query_string<S>(query: S) -> SimpleQueryStringQuerywhere
S: Into<Text>,
Creates an instance of SimpleQueryStringQuery
query
- Query string you wish to parse and use for search. See Simple query string syntax.
source§impl Query
impl Query
sourcepub fn geo_bounding_box<T, U>(field: T, bounding_box: U) -> GeoBoundingBoxQuerywhere
T: ToString,
U: Into<GeoBoundingBox>,
pub fn geo_bounding_box<T, U>(field: T, bounding_box: U) -> GeoBoundingBoxQuerywhere
T: ToString,
U: Into<GeoBoundingBox>,
Creates an instance of GeoBoundingBoxQuery
field
- Field you wish to search.bounding_box
- A series of vertex coordinates of a geo bounding box
source§impl Query
impl Query
sourcepub fn geo_distance<T, U, V>(field: T, origin: U, distance: V) -> GeoDistanceQuerywhere
T: ToString,
U: Into<GeoLocation>,
V: Into<Distance>,
pub fn geo_distance<T, U, V>(field: T, origin: U, distance: V) -> GeoDistanceQuerywhere
T: ToString,
U: Into<GeoLocation>,
V: Into<Distance>,
Creates an instance of GeoDistanceQuery
field
- Field you wish to searchorigin
- GeoPoint to measure distance todistance
- Distance threshold
source§impl Query
impl Query
sourcepub fn geo_shape_lookup<S, T>(field: S, id: T) -> GeoShapeLookupQuerywhere
S: ToString,
T: ToString,
pub fn geo_shape_lookup<S, T>(field: S, id: T) -> GeoShapeLookupQuerywhere
S: ToString,
T: ToString,
Creates an instance of GeoShapeLookupQuery
field
- Field you wish to searchid
- The ID of the document that containing the pre-indexed shape
source§impl Query
impl Query
sourcepub fn geo_shape<S, T>(field: S, shape: T) -> GeoShapeQuerywhere
S: ToString,
T: Into<GeoShape>,
pub fn geo_shape<S, T>(field: S, shape: T) -> GeoShapeQuerywhere
S: ToString,
T: Into<GeoShape>,
Creates an instance of GeoShapeQuery
field
- Field you wish to searchshape
- Shape you with to search
source§impl Query
impl Query
sourcepub fn has_child<T, U>(type: T, query: U) -> HasChildQuerywhere
T: ToString,
U: Into<Query>,
pub fn has_child<T, U>(type: T, query: U) -> HasChildQuerywhere
T: ToString,
U: Into<Query>,
Creates an instance of HasChildQuery
type
- Name of the child relationship mapped for the join field.query
- Query you wish to run on child documents of thetype
field. If a child document matches the search, the query returns the parent document.
source§impl Query
impl Query
sourcepub fn has_parent<T, U>(parent_type: T, query: U) -> HasParentQuerywhere
T: ToString,
U: Into<Query>,
pub fn has_parent<T, U>(parent_type: T, query: U) -> HasParentQuerywhere
T: ToString,
U: Into<Query>,
Creates an instance of HasParentQuery
parent-type
- Name of the parent relationship mapped for the join field.query
- Query you wish to run on parent documents of theparent_type
field. If a parent document matches the search, the query returns its child documents.
source§impl Query
impl Query
sourcepub fn nested<T, U>(path: T, query: U) -> NestedQuerywhere
T: ToString,
U: Into<Query>,
pub fn nested<T, U>(path: T, query: U) -> NestedQuerywhere
T: ToString,
U: Into<Query>,
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, thenested
query 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.
source§impl Query
impl Query
sourcepub fn parent_id<T, U>(type: T, id: U) -> ParentIdQuerywhere
T: ToString,
U: ToString,
pub fn parent_id<T, U>(type: T, id: U) -> ParentIdQuerywhere
T: ToString,
U: ToString,
Creates an instance of ParentIdQuery
type
- Name of the child relationship mapped for the join fieldid
- ID of the parent document. The query will return child documents of this parent document.
source§impl Query
impl Query
sourcepub fn shape_lookup<S, T>(field: S, id: T) -> ShapeLookupQuerywhere
S: ToString,
T: ToString,
pub fn shape_lookup<S, T>(field: S, id: T) -> ShapeLookupQuerywhere
S: ToString,
T: ToString,
Creates an instance of ShapeLookupQuery
field
- Field you wish to searchid
- The ID of the document that containing the pre-indexed shape
source§impl Query
impl Query
sourcepub fn shape<S, T>(field: S, shape: T) -> ShapeQuerywhere
S: ToString,
T: Into<Shape>,
pub fn shape<S, T>(field: S, shape: T) -> ShapeQuerywhere
S: ToString,
T: Into<Shape>,
Creates an instance of ShapeQuery
field
- Field you wish to searchshape
- Shape you with to search
source§impl Query
impl Query
sourcepub fn span_containing<T, U>(little: T, big: U) -> SpanContainingQuerywhere
T: Into<SpanQuery>,
U: Into<SpanQuery>,
pub fn span_containing<T, U>(little: T, big: U) -> SpanContainingQuerywhere
T: Into<SpanQuery>,
U: Into<SpanQuery>,
Creates an instance of SpanContainingQuery
source§impl Query
impl Query
sourcepub fn span_field_masking<Q, F>(query: Q, field: F) -> SpanFieldMaskingQuerywhere
Q: Into<SpanQuery>,
F: ToString,
pub fn span_field_masking<Q, F>(query: Q, field: F) -> SpanFieldMaskingQuerywhere
Q: Into<SpanQuery>,
F: ToString,
Creates an instance of SpanFieldMaskingQuery
source§impl Query
impl Query
sourcepub fn span_first<T>(match: T, end: u32) -> SpanFirstQuerywhere
T: Into<SpanQuery>,
pub fn span_first<T>(match: T, end: u32) -> SpanFirstQuerywhere
T: Into<SpanQuery>,
Creates an instance of SpanFirstQuery
source§impl Query
impl Query
sourcepub fn span_multi<Q>(match: Q) -> SpanMultiQuerywhere
Q: Into<MultiTermQuery>,
pub fn span_multi<Q>(match: Q) -> SpanMultiQuerywhere
Q: Into<MultiTermQuery>,
Creates an instance of SpanMultiQuery
source§impl Query
impl Query
sourcepub fn span_near<T>(clauses: T) -> SpanNearQuerywhere
T: IntoIterator,
T::Item: Into<SpanQuery>,
pub fn span_near<T>(clauses: T) -> SpanNearQuerywhere
T: IntoIterator,
T::Item: Into<SpanQuery>,
Creates an instance of SpanNearQuery
source§impl Query
impl Query
sourcepub fn span_not<T, U>(exclude: T, include: U) -> SpanNotQuerywhere
T: IntoIterator,
T::Item: Into<SpanQuery>,
U: IntoIterator,
U::Item: Into<SpanQuery>,
pub fn span_not<T, U>(exclude: T, include: U) -> SpanNotQuerywhere
T: IntoIterator,
T::Item: Into<SpanQuery>,
U: IntoIterator,
U::Item: Into<SpanQuery>,
Creates an instance of SpanNotQuery
source§impl Query
impl Query
sourcepub fn span_or<T>(clauses: T) -> SpanOrQuerywhere
T: IntoIterator,
T::Item: Into<SpanQuery>,
pub fn span_or<T>(clauses: T) -> SpanOrQuerywhere
T: IntoIterator,
T::Item: Into<SpanQuery>,
Creates an instance of SpanOrQuery
source§impl Query
impl Query
sourcepub fn span_term<T, U>(field: T, value: U) -> SpanTermQuerywhere
T: ToString,
U: Serialize,
pub fn span_term<T, U>(field: T, value: U) -> SpanTermQuerywhere
T: ToString,
U: Serialize,
Creates an instance of SpanTermQuery
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.
source§impl Query
impl Query
sourcepub fn span_within<T, U>(little: T, big: U) -> SpanWithinQuerywhere
T: Into<SpanQuery>,
U: Into<SpanQuery>,
pub fn span_within<T, U>(little: T, big: U) -> SpanWithinQuerywhere
T: Into<SpanQuery>,
U: Into<SpanQuery>,
Creates an instance of SpanWithinQuery
source§impl Query
impl Query
sourcepub fn distance_feature<T, O>(
field: T,
origin: O,
pivot: <O as Origin>::Pivot
) -> DistanceFeatureQuery<O>where
T: ToString,
O: Origin,
pub fn distance_feature<T, O>(
field: T,
origin: O,
pivot: <O as Origin>::Pivot
) -> DistanceFeatureQuery<O>where
T: ToString,
O: Origin,
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_nanos
orgeo_point
field - Have an index
mapping parameter value of
true
, which is the default - Have an
doc_values
mapping parameter value oftrue
, which is the default
- Be a
origin
- Date or point of origin used to calculate distances.
If thefield
value is adate
ordate_nanos
field, theorigin
value must be a date. Date Math, such asnow-1h
, is supported.
If thefield
value is ageo_point
field, theorigin
value must be a geopoint.pivot
- Distance from theorigin
at which relevance scores receive half of the boost value.
If the field value is adate
ordate_nanos
field, thepivot
value must be atime unit
, such as1h
or10d
.
If thefield
value is ageo_point
field, thepivot
value must be a distance unit , such as1km
or12m
.
source§impl Query
impl Query
sourcepub fn more_like_this<I>(like: I) -> MoreLikeThisQuerywhere
I: IntoIterator,
I::Item: Into<Like>,
pub fn more_like_this<I>(like: I) -> MoreLikeThisQuerywhere
I: IntoIterator,
I::Item: Into<Like>,
Creates an instance of MoreLikeThisQuery
like
- free form text and/or a single or multiple documents.
source§impl Query
impl Query
sourcepub fn percolate_lookup<S, T, U>(
field: S,
index: T,
id: U
) -> PercolateLookupQuerywhere
S: ToString,
T: ToString,
U: ToString,
pub fn percolate_lookup<S, T, U>(
field: S,
index: T,
id: U
) -> PercolateLookupQuerywhere
S: ToString,
T: ToString,
U: ToString,
Creates an instance of PercolateLookupQuery
field
- The field of typepercolator
that holds the indexed queriesindex
- The index the document resides inid
- The id of the document to fetch
source§impl Query
impl Query
sourcepub fn percolate<S, T>(field: S, source: T) -> PercolateQuerywhere
S: ToString,
T: Serialize,
pub fn percolate<S, T>(field: S, source: T) -> PercolateQuerywhere
S: ToString,
T: Serialize,
Creates an instance of PercolateQuery
field
- The field of typepercolator
that holds the indexed queriessource
- Source to percolate
source§impl Query
impl Query
sourcepub fn pinned<Q>(values: PinnedQueryValues, organic: Q) -> PinnedQuerywhere
Q: Into<Query>,
pub fn pinned<Q>(values: PinnedQueryValues, organic: Q) -> PinnedQuerywhere
Q: Into<Query>,
Creates an instance of PinnedQuery
source§impl Query
impl Query
sourcepub fn rank_feature<T>(field: T) -> RankFeatureQuerywhere
T: ToString,
pub fn rank_feature<T>(field: T) -> RankFeatureQuerywhere
T: ToString,
Creates an instance of RankFeatureQuery
field
-rank_feature
orrank_features
field used to boost relevance scores
source§impl Query
impl Query
sourcepub fn script(script: Script) -> ScriptQuery
pub fn script(script: Script) -> ScriptQuery
Creates an instance of ScriptQuery
script
- Contains a script to run as a query. This script must return a boolean value,true
orfalse
source§impl Query
impl Query
sourcepub fn script_score<Q>(query: Q, script: Script) -> ScriptScoreQuerywhere
Q: Into<Query>,
pub fn script_score<Q>(query: Q, script: Script) -> ScriptScoreQuerywhere
Q: Into<Query>,
Creates an instance of ScriptScoreQuery
query
- Query used to return documentsscript
- Script used to compute the score of documents returned by thequery
source§impl Query
impl Query
sourcepub fn wrapper<S>(query: S) -> WrapperQuerywhere
S: ToString,
pub fn wrapper<S>(query: S) -> WrapperQuerywhere
S: ToString,
Creates an instance of WrapperQuery
source§impl Query
impl Query
sourcepub fn exists<T>(field: T) -> ExistsQuerywhere
T: ToString,
pub fn exists<T>(field: T) -> ExistsQuerywhere
T: ToString,
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 isnull
or[]
, these values will indicate the field does exist:- Empty strings, such as
""
or"-"
- Arrays containing
null
and another value, such as[null, "foo"]
- A custom
null-value
, defined in field mapping
- Empty strings, such as
source§impl Query
impl Query
sourcepub fn fuzzy<T, U>(field: T, value: U) -> FuzzyQuerywhere
T: ToString,
U: Serialize,
pub fn fuzzy<T, U>(field: T, value: U) -> FuzzyQuerywhere
T: ToString,
U: Serialize,
Creates an instance of FuzzyQuery
field
- Field you wish to search.value
- Fuzzy you wish to find in the provided field.
source§impl Query
impl Query
sourcepub fn ids<I>(values: I) -> IdsQuerywhere
I: IntoIterator,
I::Item: ToString,
pub fn ids<I>(values: I) -> IdsQuerywhere
I: IntoIterator,
I::Item: ToString,
Creates an instance of IdsQuery
values
- An array of document IDs.
source§impl Query
impl Query
sourcepub fn prefix<T, U>(field: T, value: U) -> PrefixQuerywhere
T: ToString,
U: Serialize,
pub fn prefix<T, U>(field: T, value: U) -> PrefixQuerywhere
T: ToString,
U: Serialize,
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.
source§impl Query
impl Query
sourcepub fn range<T>(field: T) -> RangeQuerywhere
T: ToString,
pub fn range<T>(field: T) -> RangeQuerywhere
T: ToString,
Creates an instance of RangeQuery
field
- Field you wish to search.
source§impl Query
impl Query
sourcepub fn regexp<S>(field: S, value: S) -> RegexpQuerywhere
S: ToString,
pub fn regexp<S>(field: S, value: S) -> RegexpQuerywhere
S: ToString,
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.
source§impl Query
impl Query
sourcepub fn term<T, U>(field: T, value: U) -> TermQuerywhere
T: ToString,
U: Serialize,
pub fn term<T, U>(field: T, value: U) -> TermQuerywhere
T: ToString,
U: Serialize,
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.
source§impl Query
impl Query
sourcepub fn terms_lookup<S, T, U, V>(
field: S,
index: T,
id: U,
path: V
) -> TermsLookupQuerywhere
S: ToString,
T: ToString,
U: ToString,
V: ToString,
pub fn terms_lookup<S, T, U, V>(
field: S,
index: T,
id: U,
path: V
) -> TermsLookupQuerywhere
S: ToString,
T: ToString,
U: ToString,
V: ToString,
Creates an instance of TermsLookupQuery
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.
source§impl Query
impl Query
sourcepub fn terms<S, I>(field: S, terms: I) -> TermsQuerywhere
S: ToString,
I: Into<Terms>,
pub fn terms<S, I>(field: S, terms: I) -> TermsQuerywhere
S: ToString,
I: Into<Terms>,
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 theterms
query 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.
source§impl Query
impl Query
sourcepub fn terms_set<S, T, U>(
field: S,
terms: T,
minimum_should_match: U
) -> TermsSetQuerywhere
S: ToString,
T: Into<Terms>,
U: Into<TermsSetMinimumShouldMatch>,
pub fn terms_set<S, T, U>(
field: S,
terms: T,
minimum_should_match: U
) -> TermsSetQuerywhere
S: ToString,
T: Into<Terms>,
U: Into<TermsSetMinimumShouldMatch>,
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.
source§impl Query
impl Query
sourcepub fn wildcard<T, U>(field: T, value: U) -> WildcardQuerywhere
T: ToString,
U: Serialize,
pub fn wildcard<T, U>(field: T, value: U) -> WildcardQuerywhere
T: ToString,
U: Serialize,
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.
source§impl Query
impl Query
sourcepub fn match_all() -> MatchAllQuery
pub fn match_all() -> MatchAllQuery
Creates an instance of MatchAllQuery
source§impl Query
impl Query
sourcepub fn match_none() -> MatchNoneQuery
pub fn match_none() -> MatchNoneQuery
Creates an instance of MatchNoneQuery