Query

Description

An Elasticsearch Query DSL (Domain Specific Language) object that defines a query.

Read the reference documentation

Properties

common map string to object · min properties: 1 · max properties: 1
distance_feature union oneOf

Boosts the relevance score of documents closer to a provided origin date or point. For example, you can use this query to give more weight to documents closer to a certain date or location.

One of:
boost number · default: 1

Floating point number used to decrease or increase the relevance scores of the query. Boost values are relative to the default value of 1.0. A boost value between 0 and 1.0 decreases the relevance score. A value greater than 1.0 increases the relevance score.

_name string
origin object required

Date or point of origin used to calculate distances. If the field value is a date or date_nanos field, the origin value must be a date. Date Math, such as now-1h, is supported. If the field value is a geo_point field, the origin value must be a geopoint.

pivot object required

Distance from the origin at which relevance scores receive half of the boost value. If the field value is a date or date_nanos field, the pivot value must be a time unit, such as 1h or 10d. If the field value is a geo_point field, the pivot value must be a distance unit, such as 1km or 12m.

field string required

Name of the field used to calculate distances. This field must meet the following criteria: be a date, date_nanos or geo_point field; have an index mapping parameter value of true, which is the default; have an doc_values mapping parameter value of true, which is the default.

fuzzy map string to object · min properties: 1 · max properties: 1

Returns documents that contain terms similar to the search term, as measured by a Levenshtein edit distance.

geo_grid map string to object · min properties: 1 · max properties: 1

Matches geo_point and geo_shape values that intersect a grid cell from a GeoGrid aggregation.

intervals map string to object · min properties: 1 · max properties: 1

Returns documents based on the order and proximity of matching terms.

match map string to object · min properties: 1 · max properties: 1

Returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching.

match_bool_prefix map string to object · min properties: 1 · max properties: 1

Analyzes its input and constructs a bool query from the terms. Each term except the last is used in a term query. The last term is used in a prefix query.

match_phrase map string to object · min properties: 1 · max properties: 1

Analyzes the text and creates a phrase query out of the analyzed text.

match_phrase_prefix map string to object · min properties: 1 · max properties: 1

Returns documents that contain the words of a provided text, in the same order as provided. The last term of the provided text is treated as a prefix, matching any words that begin with that term.

prefix map string to object · min properties: 1 · max properties: 1

Returns documents that contain a specific prefix in a provided field.

range map string to oneOf · min properties: 1 · max properties: 1

Returns documents that contain terms within a provided range.

regexp map string to object · min properties: 1 · max properties: 1

Returns documents that contain terms matching a regular expression.

span_term map string to object · min properties: 1 · max properties: 1

Matches spans containing a term.

term map string to object · min properties: 1 · max properties: 1

Returns documents that contain an exact term in a provided field. To return a document, the query term must exactly match the queried field's value, including whitespace and capitalization.

terms_set map string to object · min properties: 1 · max properties: 1

Returns documents that contain a minimum number of exact terms in a provided field. To return a document, a required number of terms must exactly match the field values, including whitespace and capitalization.

text_expansion map string to object · min properties: 1 · max properties: 1

Uses a natural language processing model to convert the query text into a list of token-weight pairs which are then used in a query against a sparse vector or rank features field.

weighted_tokens map string to object · min properties: 1 · max properties: 1

Supports returning text_expansion query results by sending in precomputed tokens with the query.

wildcard map string to object · min properties: 1 · max properties: 1

Returns documents that contain terms matching a wildcard pattern.