Run an async search Generally available; Added in 7.7.0

POST /_async_search

When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested.

Warning: Asynchronous search does not support scroll or search requests that include only the suggest section.

By default, Elasticsearch does not allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. The maximum allowed size for a stored async search response can be set by changing the search.max_async_search_response_size cluster level setting.

Query parameters

  • wait_for_completion_timeout string

    Blocks and waits until the search is completed up to a certain timeout. When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster.

    Values are -1 or 0.

    External documentation
  • keep_alive string

    Specifies how long the async search needs to be available. Ongoing async searches and any saved search results are deleted after this period.

    Values are -1 or 0.

    External documentation
  • keep_on_completion boolean

    If true, results are stored for later retrieval when the search completes within the wait_for_completion_timeout.

  • allow_no_indices boolean

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)

  • allow_partial_search_results boolean

    Indicate if an error should be returned if there is a partial search failure or timeout

  • analyzer string

    The analyzer to use for the query string

  • analyze_wildcard boolean

    Specify whether wildcard and prefix queries should be analyzed

  • batched_reduce_size number

    Affects how often partial results become available, which happens whenever shard results are reduced. A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default).

  • ccs_minimize_roundtrips boolean

    The default value is the only supported value.

  • default_operator string

    The default operator for query string query (AND or OR)

    Values are and, AND, or, or OR.

  • df string

    The field to use as default where no field prefix is given in the query string

  • docvalue_fields string | array[string]

    A comma-separated list of fields to return as the docvalue representation of a field for each hit

  • expand_wildcards string | array[string]

    Whether to expand wildcard expression to concrete indices that are open, closed or both

    Values are all, open, closed, hidden, or none.

  • explain boolean

    Specify whether to return detailed information about score computation as part of a hit

  • ignore_throttled boolean

    Whether specified concrete, expanded or aliased indices should be ignored when throttled

  • ignore_unavailable boolean

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • lenient boolean

    Specify whether format-based query failures (such as providing text to a numeric field) should be ignored

  • max_concurrent_shard_requests number

    The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests

  • preference string

    Specify the node or shard the operation should be performed on

  • request_cache boolean

    Specify if request cache should be used for this request or not, defaults to true

  • routing string | array[string]

    A comma-separated list of specific routing values

  • search_type string

    Search operation type

    Values are query_then_fetch or dfs_query_then_fetch.

  • stats array[string]

    Specific 'tag' of the request for logging and statistical purposes

  • stored_fields string | array[string]

    A comma-separated list of stored fields to return as part of a hit

  • suggest_field string

    Specifies which field to use for suggestions.

  • suggest_mode string

    Specify suggest mode

    Values are missing, popular, or always.

  • suggest_size number

    How many suggestions to return in response

  • suggest_text string

    The source text for which the suggestions should be returned.

  • terminate_after number

    The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early

  • timeout string

    Explicit operation timeout

    Values are -1 or 0.

    External documentation
  • track_total_hits boolean | number

    Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number.

  • track_scores boolean

    Whether to calculate and return scores even if they are not used for sorting

  • typed_keys boolean

    Specify whether aggregation and suggester names should be prefixed by their respective types in the response

  • rest_total_hits_as_int boolean

    Indicates whether hits.total should be rendered as an integer or an object in the rest search response

  • version boolean

    Specify whether to return document version as part of a hit

  • _source boolean | string | array[string]

    True or false to return the _source field or not, or a list of fields to return

  • _source_excludes string | array[string]

    A list of fields to exclude from the returned _source field

  • _source_includes string | array[string]

    A list of fields to extract and return from the _source field

  • seq_no_primary_term boolean

    Specify whether to return sequence number and primary term of the last modification of each hit

  • q string

    Query in the Lucene query string syntax

  • size number

    Number of hits to return

  • from number

    Starting offset

  • sort string | array[string]

    A comma-separated list of : pairs

application/json

Body

  • aggregations object
  • collapse object
    Hide collapse attributes Show collapse attributes object
    • field string Required

      The field to collapse the result set on

    • inner_hits object | array[object]

      The number of inner hits and their sort order

      One of:
      Hide attributes Show attributes object
      • name string

        The name for the particular inner hit definition in the response. Useful when a search request contains multiple inner hits.

      • size number

        The maximum number of hits to return per inner_hits.

        Default value is 3.0.

      • from number

        Inner hit starting document offset.

        Default value is 0.0.

      • collapse object
      • docvalue_fields array[object]

        A reference to a field with formatting instructions on how to return the value

        A reference to a field with formatting instructions on how to return the value

      • explain boolean
      • highlight
      • ignore_unmapped boolean
      • script_fields object
        Hide script_fields attribute Show script_fields attribute object
        • * object Additional properties
      • seq_no_primary_term boolean
      • fields array[string]

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • sort
      • _source
      • stored_fields string | array[string]
      • track_scores boolean

        Default value is false.

      • version boolean
    • max_concurrent_group_searches number

      The number of concurrent requests allowed to retrieve the inner_hits per group

    • collapse object
  • explain boolean

    If true, returns detailed information about score computation as part of a hit.

    Default value is false.

  • ext object

    Configuration of search extensions defined by Elasticsearch plugins.

    Hide ext attribute Show ext attribute object
    • * object Additional properties
  • from number

    Starting document offset. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

    Default value is 0.0.

  • highlight object
    Hide highlight attributes Show highlight attributes object
    • type string

      Any of:

      Values are plain, fvh, or unified.

    • boundary_chars string

      A string that contains each boundary character.

      Default value is .,!? \t\n.

    • boundary_max_scan number

      How far to scan for boundary characters.

      Default value is 20.0.

    • boundary_scanner string

      Specifies how to break the highlighted fragments: chars, sentence, or word. Only valid for the unified and fvh highlighters. Defaults to sentence for the unified highlighter. Defaults to chars for the fvh highlighter.

      Values are chars, sentence, or word.

    • boundary_scanner_locale string

      Controls which locale is used to search for sentence and word boundaries. This parameter takes a form of a language tag, for example: "en-US", "fr-FR", "ja-JP".

      Default value is Locale.ROOT.

    • force_source boolean Deprecated
    • fragmenter string

      Specifies how text should be broken up in highlight snippets: simple or span. Only valid for the plain highlighter.

      Values are simple or span.

    • fragment_size number

      The size of the highlighted fragment in characters.

      Default value is 100.0.

    • highlight_filter boolean
    • highlight_query object

      Highlight matches for a query other than the search query. This is especially useful if you use a rescore query because those are not taken into account by highlighting by default.

      External documentation
      Hide highlight_query attributes Show highlight_query attributes object
      • common object Deprecated
      • distance_feature
      • fuzzy object

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

        External documentation
      • geo_grid object

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

      • intervals object

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

        External documentation
      • match object

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

        External documentation
      • match_bool_prefix object

        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.

        External documentation
      • match_phrase object

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

        External documentation
      • match_phrase_prefix object

        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.

        External documentation
      • prefix object

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

        External documentation
      • range object

        Returns documents that contain terms within a provided range.

        External documentation
      • regexp object

        Returns documents that contain terms matching a regular expression.

        External documentation
      • span_term object

        Matches spans containing a term.

        External documentation
      • term object

        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.

        External documentation
      • terms_set object

        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.

        External documentation
      • text_expansion object Deprecated Generally available; Added in 8.8.0

        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.

        External documentation
      • weighted_tokens object Deprecated Generally available; Added in 8.13.0

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

        External documentation
      • wildcard object

        Returns documents that contain terms matching a wildcard pattern.

        External documentation
    • max_fragment_length number
    • max_analyzed_offset number

      If set to a non-negative value, highlighting stops at this defined maximum limit. The rest of the text is not processed, thus not highlighted and no error is returned The max_analyzed_offset query setting does not override the index.highlight.max_analyzed_offset setting, which prevails when it’s set to lower value than the query setting.

    • no_match_size number

      The amount of text you want to return from the beginning of the field if there are no matching fragments to highlight.

      Default value is 0.0.

    • number_of_fragments number

      The maximum number of fragments to return. If the number of fragments is set to 0, no fragments are returned. Instead, the entire field contents are highlighted and returned. This can be handy when you need to highlight short texts such as a title or address, but fragmentation is not required. If number_of_fragments is 0, fragment_size is ignored.

      Default value is 5.0.

    • options object
      Hide options attribute Show options attribute object
      • * object Additional properties
    • order string

      Sorts highlighted fragments by score when set to score. By default, fragments will be output in the order they appear in the field (order: none). Setting this option to score will output the most relevant fragments first. Each highlighter applies its own logic to compute relevancy scores.

      Value is score.

    • phrase_limit number

      Controls the number of matching phrases in a document that are considered. Prevents the fvh highlighter from analyzing too many phrases and consuming too much memory. When using matched_fields, phrase_limit phrases per matched field are considered. Raising the limit increases query time and consumes more memory. Only supported by the fvh highlighter.

      Default value is 256.0.

    • post_tags array[string]

      Use in conjunction with pre_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

    • pre_tags array[string]

      Use in conjunction with post_tags to define the HTML tags to use for the highlighted text. By default, highlighted text is wrapped in <em> and </em> tags.

    • require_field_match boolean

      By default, only fields that contains a query match are highlighted. Set to false to highlight all fields.

      Default value is true.

    • tags_schema string

      Set to styled to use the built-in tag schema.

      Value is styled.

    • encoder string

      Values are default or html.

    • fields object | array[object] Required

  • track_total_hits boolean | number

    Number of hits matching the query to count accurately. If true, the exact number of hits is returned at the cost of some performance. If false, the response does not include the total number of hits matching the query. Defaults to 10,000 hits.

  • indices_boost array[object]

    Boosts the _score of documents from specified indices.

    Hide indices_boost attribute Show indices_boost attribute object
    • * number Additional properties
  • docvalue_fields array[object]

    Array of wildcard (*) patterns. The request returns doc values for field names matching these patterns in the hits.fields property of the response.

    Hide docvalue_fields attributes Show docvalue_fields attributes object

    A reference to a field with formatting instructions on how to return the value

    • field string Required

      A wildcard pattern. The request returns values for field names matching this pattern.

    • format string

      The format in which the values are returned.

    • include_unmapped boolean
  • knn object | array[object] Generally available; Added in 8.4.0

    Defines the approximate kNN search to run.

    One of:
    Hide attributes Show attributes object
    • field string Required

      The name of the vector field to search against

    • query_vector array[number]

      The query vector

    • query_vector_builder object

      The query vector builder. You must provide a query_vector_builder or query_vector, but not both.

      Hide query_vector_builder attribute Show query_vector_builder attribute object
      • text_embedding object
    • k number

      The final number of nearest neighbors to return as top hits

    • num_candidates number

      The number of nearest neighbor candidates to consider per shard

    • visit_percentage number Generally available; Added in 9.2.0

      The percentage of vectors to explore per shard while doing knn search with bbq_disk

    • boost number

      Boost value to apply to kNN scores

    • filter object | array[object]

      Filters for the kNN search query

      One of:
      Hide attributes Show attributes object

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

      External documentation
      • bool
      • boosting
      • common object Deprecated
      • combined_fields
      • constant_score
      • dis_max
      • distance_feature
      • exists
      • function_score
      • fuzzy object

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

      • geo_bounding_box
      • geo_distance
      • geo_grid object

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

      • geo_polygon
      • geo_shape
      • has_child
      • has_parent
      • ids
      • intervals object

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

      • knn
      • match object

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

      • match_all
      • match_bool_prefix object

        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_none
      • match_phrase object

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

      • match_phrase_prefix object

        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.

      • more_like_this
      • multi_match
      • nested
      • parent_id
      • percolate
      • pinned
      • prefix object

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

      • query_string
      • range object

        Returns documents that contain terms within a provided range.

      • rank_feature
      • regexp object

        Returns documents that contain terms matching a regular expression.

      • rule
      • script
      • script_score
      • semantic
      • shape
      • simple_query_string
      • span_containing
      • span_field_masking
      • span_first
      • span_multi
      • span_near
      • span_not
      • span_or
      • span_term object

        Matches spans containing a term.

      • span_within
      • sparse_vector
      • term object

        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
      • terms_set object

        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 object Deprecated Generally available; Added in 8.8.0

        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 object Deprecated Generally available; Added in 8.13.0

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

      • wildcard object

        Returns documents that contain terms matching a wildcard pattern.

      • wrapper
      • type
    • similarity number

      The minimum similarity for a vector to be considered a match

    • inner_hits object

      If defined, each search hit will contain inner hits.

      External documentation
      Hide inner_hits attributes Show inner_hits attributes object
      • name string

        The name for the particular inner hit definition in the response. Useful when a search request contains multiple inner hits.

      • size number

        The maximum number of hits to return per inner_hits.

        Default value is 3.0.

      • from number

        Inner hit starting document offset.

        Default value is 0.0.

      • collapse object
      • docvalue_fields array[object]

        A reference to a field with formatting instructions on how to return the value

        A reference to a field with formatting instructions on how to return the value

      • explain boolean
      • ignore_unmapped boolean
      • script_fields object
        Hide script_fields attribute Show script_fields attribute object
        • * object Additional properties
      • seq_no_primary_term boolean
      • fields array[string]

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • sort
      • _source
      • stored_fields string | array[string]
      • track_scores boolean

        Default value is false.

      • version boolean
    • rescore_vector object Generally available; Added in 8.18.0

      Apply oversampling and rescoring to quantized vectors

      Hide rescore_vector attribute Show rescore_vector attribute object
      • oversample number Required

        Applies the specified oversample factor to k on the approximate kNN search

    • _name string
  • min_score number

    Minimum _score for matching documents. Documents with a lower _score are not included in search results and results collected by aggregations.

  • post_filter object

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

    External documentation
    Hide post_filter attributes Show post_filter attributes object
    • bool object

      matches documents matching boolean combinations of other queries.

      External documentation
      Hide bool attributes Show bool attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • filter object | array[object]

        The clause (query) must appear in matching documents. However, unlike must, the score of the query will be ignored.

        One of:

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

      • minimum_should_match
      • must object | array[object]

        The clause (query) must appear in matching documents and will contribute to the score.

        One of:

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

      • must_not object | array[object]

        The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of 0 is returned for all documents.

        One of:

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

      • should object | array[object]

        The clause (query) should appear in the matching document.

        One of:

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

    • boosting object

      Returns documents matching a positive query while reducing the relevance score of documents that also match a negative query.

      External documentation
      Hide boosting attributes Show boosting attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • negative_boost number Required

        Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the negative query.

      • negative object Required

        Query used to decrease the relevance score of matching documents.

      • positive object Required

        Any returned documents must match this query.

    • common object Deprecated
    • combined_fields object Generally available; Added in 7.13.0

      The combined_fields query supports searching multiple text fields as if their contents had been indexed into one combined field.

      External documentation
      Hide combined_fields attributes Show combined_fields attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • fields array[string] Required

        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 string Required

        Text to search for in the provided fields. The combined_fields query analyzes the provided text before performing a search.

      • auto_generate_synonyms_phrase_query boolean

        If true, match phrase queries are automatically created for multi-term synonyms.

        Default value is true.

      • operator string

        Boolean logic used to interpret text in the query value.

        Values are or or and.

      • minimum_should_match
      • zero_terms_query string

        Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter.

        Values are none or all.

    • constant_score object

      Wraps a filter query and returns every matching document with a relevance score equal to the boost parameter value.

      External documentation
      Hide constant_score attributes Show constant_score attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • filter object Required

        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.

    • dis_max object

      Returns documents matching one or more wrapped queries, called query clauses or clauses. If a returned document matches multiple query clauses, the dis_max query assigns the document the highest relevance score from any matching clause, plus a tie breaking increment for any additional matching subqueries.

      External documentation
      Hide dis_max attributes Show dis_max attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • queries array[object] Required

        One or more query clauses. Returned documents must match one or more of these queries. If a document matches multiple queries, Elasticsearch uses the highest relevance score.

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

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

      • tie_breaker number

        Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses.

        Default value is 0.0.

    • distance_feature object Required

      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.

      External documentation
    • exists object

      Returns documents that contain an indexed value for a field.

      External documentation
      Hide exists attributes Show exists attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        Name of the field you wish to search.

    • function_score object

      The function_score enables you to modify the score of documents that are retrieved by a query.

      External documentation
      Hide function_score attributes Show function_score attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • boost_mode string

        Defines how he newly computed score is combined with the score of the query

        Values are multiply, replace, sum, avg, max, or min.

      • functions array[object]

        One or more functions that compute a new score for each document returned by the query.

      • max_boost number

        Restricts the new score to not exceed the provided limit.

      • min_score number

        Excludes documents that do not meet the provided score threshold.

      • query object

        A query that determines the documents for which a new score is computed.

      • score_mode string

        Specifies how the computed scores are combined

        Values are multiply, sum, avg, first, max, or min.

    • fuzzy object

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

      External documentation
    • geo_bounding_box object

      Matches geo_point and geo_shape values that intersect a bounding box.

      External documentation
      Hide geo_bounding_box attributes Show geo_bounding_box attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • type string

        Values are memory or indexed.

      • validation_method string

        Set to IGNORE_MALFORMED to accept geo points with invalid latitude or longitude. Set to COERCE to also try to infer correct latitude or longitude.

        Values are coerce, ignore_malformed, or strict.

      • ignore_unmapped boolean

        Set to true to ignore an unmapped field and not match any documents for this query. Set to false to throw an exception if the field is not mapped.

        Default value is false.

    • geo_distance object

      Matches geo_point and geo_shape values within a given distance of a geopoint.

      External documentation
      Hide geo_distance attributes Show geo_distance attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • distance string Required

        The radius of the circle centred on the specified location. Points which fall into this circle are considered to be matches.

      • distance_type string

        How to compute the distance. Set to plane for a faster calculation that's inaccurate on long distances and close to the poles.

        Values are arc or plane.

      • validation_method string

        Set to IGNORE_MALFORMED to accept geo points with invalid latitude or longitude. Set to COERCE to also try to infer correct latitude or longitude.

        Values are coerce, ignore_malformed, or strict.

      • ignore_unmapped boolean

        Set to true to ignore an unmapped field and not match any documents for this query. Set to false to throw an exception if the field is not mapped.

        Default value is false.

    • geo_grid object

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

    • geo_polygon object
      Hide geo_polygon attributes Show geo_polygon attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • validation_method string

        Values are coerce, ignore_malformed, or strict.

      • ignore_unmapped boolean
    • geo_shape object

      Filter documents indexed using either the geo_shape or the geo_point type.

      External documentation
      Hide geo_shape attributes Show geo_shape attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Set to true to ignore an unmapped field and not match any documents for this query. Set to false to throw an exception if the field is not mapped.

        Default value is false.

    • has_child object

      Returns parent documents whose joined child documents match a provided query.

      External documentation
      Hide has_child attributes Show has_child attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped type and not return any documents instead of an error.

        Default value is false.

      • inner_hits object

        If defined, each search hit will contain inner hits.

      • max_children number

        Maximum number of child documents that match the query allowed for a returned parent document. If the parent document exceeds this limit, it is excluded from the search results.

      • min_children number

        Minimum number of child documents that match the query required to match the query for a returned parent document. If the parent document does not meet this limit, it is excluded from the search results.

      • query object Required

        Query you wish to run on child documents of the type field. If a child document matches the search, the query returns the parent document.

      • score_mode string

        Indicates how scores for matching child documents affect the root parent document’s relevance score.

        Values are none, avg, sum, max, or min.

      • type string Required

        Name of the child relationship mapped for the join field.

    • has_parent object

      Returns child documents whose joined parent document matches a provided query.

      External documentation
      Hide has_parent attributes Show has_parent attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped parent_type and not return any documents instead of an error. You can use this parameter to query multiple indices that may not contain the parent_type.

        Default value is false.

      • inner_hits object

        If defined, each search hit will contain inner hits.

      • parent_type string Required

        Name of the parent relationship mapped for the join field.

      • query object Required

        Query you wish to run on parent documents of the parent_type field. If a parent document matches the search, the query returns its child documents.

      • score boolean

        Indicates whether the relevance score of a matching parent document is aggregated into its child documents.

        Default value is false.

    • ids object

      Returns documents based on their IDs. This query uses document IDs stored in the _id field.

      External documentation
      Hide ids attributes Show ids attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • values
    • intervals object

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

      External documentation
    • knn object

      Finds the k nearest vectors to a query vector, as measured by a similarity metric. knn query finds nearest vectors through approximate search on indexed dense_vectors.

      External documentation
      Hide knn attributes Show knn attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        The name of the vector field to search against

      • query_vector array[number]

        The query vector

      • query_vector_builder object

        The query vector builder. You must provide a query_vector_builder or query_vector, but not both.

      • num_candidates number

        The number of nearest neighbor candidates to consider per shard

      • visit_percentage number Generally available; Added in 9.2.0

        The percentage of vectors to explore per shard while doing knn search with bbq_disk

      • k number

        The final number of nearest neighbors to return as top hits

      • filter object | array[object]

        Filters for the kNN search query

        One of:

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

      • similarity number

        The minimum similarity for a vector to be considered a match

      • rescore_vector object

        Apply oversampling and rescoring to quantized vectors

    • match object

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

      External documentation
    • match_all object

      Matches all documents, giving them all a _score of 1.0.

      External documentation
      Hide match_all attributes Show match_all attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
    • match_bool_prefix object

      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.

      External documentation
    • match_none object

      Matches no documents.

      External documentation
      Hide match_none attributes Show match_none attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
    • match_phrase object

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

      External documentation
    • match_phrase_prefix object

      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.

      External documentation
    • more_like_this object

      Returns documents that are "like" a given set of documents.

      External documentation
      Hide more_like_this attributes Show more_like_this attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • analyzer string

        The analyzer that is used to analyze the free form text. Defaults to the analyzer associated with the first field in fields.

        External documentation
      • boost_terms number

        Each term in the formed query could be further boosted by their tf-idf score. This sets the boost factor to use when using this feature. Defaults to deactivated (0).

        Default value is 0.0.

      • fail_on_unsupported_field boolean

        Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (text or keyword).

        Default value is true.

      • fields array[string]

        A list of fields to fetch and analyze the text from. Defaults to the index.query.default_field index setting, which has a default value of *.

      • include boolean

        Specifies whether the input documents should also be included in the search results returned.

        Default value is false.

      • like array[string | object] Required
      • max_doc_freq number

        The maximum document frequency above which the terms are ignored from the input document.

      • max_query_terms number

        The maximum number of query terms that can be selected.

        Default value is 25.0.

      • max_word_length number

        The maximum word length above which the terms are ignored. Defaults to unbounded (0).

        Default value is 0.0.

      • min_doc_freq number

        The minimum document frequency below which the terms are ignored from the input document.

        Default value is 5.0.

      • minimum_should_match
      • min_term_freq number

        The minimum term frequency below which the terms are ignored from the input document.

        Default value is 2.0.

      • min_word_length number

        The minimum word length below which the terms are ignored.

        Default value is 0.0.

      • routing string
      • stop_words
      • unlike array[string | object]
      • version number
      • version_type string

        Values are internal, external, or external_gte.

    • multi_match object

      Enables you to search for a provided text, number, date or boolean value across multiple fields. The provided text is analyzed before matching.

      External documentation
      Hide multi_match attributes Show multi_match attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • analyzer string

        Analyzer used to convert the text in the query value into tokens.

      • auto_generate_synonyms_phrase_query boolean

        If true, match phrase queries are automatically created for multi-term synonyms.

        Default value is true.

      • cutoff_frequency number Deprecated
      • fields string | array[string]

        The fields to be queried. Defaults to the index.query.default_field index settings, which in turn defaults to *.

      • fuzziness
      • fuzzy_rewrite string

        Method used to rewrite the query.

      • fuzzy_transpositions boolean

        If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba). Can be applied to the term subqueries constructed for all terms but the final term.

        Default value is true.

      • lenient boolean

        If true, format-based errors, such as providing a text query value for a numeric field, are ignored.

        Default value is false.

      • max_expansions number

        Maximum number of terms to which the query will expand.

        Default value is 50.0.

      • minimum_should_match
      • operator string

        Boolean logic used to interpret text in the query value.

        Values are and, AND, or, or OR.

      • prefix_length number

        Number of beginning characters left unchanged for fuzzy matching.

        Default value is 0.0.

      • query string Required

        Text, number, boolean value or date you wish to find in the provided field.

      • slop number

        Maximum number of positions allowed between matching tokens.

        Default value is 0.0.

      • tie_breaker number

        Determines how scores for each per-term blended query and scores across groups are combined.

        Default value is 0.0.

      • type string

        How the multi_match query is executed internally.

        Values are best_fields, most_fields, cross_fields, phrase, phrase_prefix, or bool_prefix.

      • zero_terms_query string

        Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter.

        Values are all or none.

    • nested object

      Wraps another query to search nested fields. If an object matches the search, the nested query returns the root parent document.

      External documentation
      Hide nested attributes Show nested attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped path and not return any documents instead of an error.

        Default value is false.

      • inner_hits object

        If defined, each search hit will contain inner hits.

      • path string Required

        Path to the nested object you wish to search.

      • query object Required

        Query you wish to run on nested objects in the path.

      • score_mode string

        How scores for matching child objects affect the root parent document’s relevance score.

        Values are none, avg, sum, max, or min.

    • parent_id object

      Returns child documents joined to a specific parent document.

      External documentation
      Hide parent_id attributes Show parent_id attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • id string

        ID of the parent document.

      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped type and not return any documents instead of an error.

        Default value is false.

      • type string

        Name of the child relationship mapped for the join field.

    • percolate object

      Matches queries stored in an index.

      External documentation
      Hide percolate attributes Show percolate attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • document object

        The source of the document being percolated.

      • documents array[object]

        An array of sources of the documents being percolated.

      • field string Required

        Field that holds the indexed queries. The field must use the percolator mapping type.

      • id string

        The ID of a stored document to percolate.

      • index string

        The index of a stored document to percolate.

      • name string

        The suffix used for the _percolator_document_slot field when multiple percolate queries are specified.

      • preference string

        Preference used to fetch document to percolate.

      • routing string

        Routing used to fetch document to percolate.

      • version number

        The expected version of a stored document to percolate.

    • pinned object

      Promotes selected documents to rank higher than those matching a given query.

      External documentation
      Hide pinned attributes Show pinned attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ids array[string]

        Document IDs listed in the order they are to appear in results. Required if docs is not specified.

      • docs array[object]

        Documents listed in the order they are to appear in results. Required if ids is not specified.

    • prefix object

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

      External documentation
    • query_string object

      Returns documents based on a provided query string, using a parser with a strict syntax.

      External documentation
      Hide query_string attributes Show query_string attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • allow_leading_wildcard boolean

        If true, the wildcard characters * and ? are allowed as the first character of the query string.

        Default value is true.

      • analyzer string

        Analyzer used to convert text in the query string into tokens.

      • analyze_wildcard boolean

        If true, the query attempts to analyze wildcard terms in the query string.

        Default value is false.

      • auto_generate_synonyms_phrase_query boolean

        If true, match phrase queries are automatically created for multi-term synonyms.

        Default value is true.

      • default_field string

        Default field to search if no field is provided in the query string. Supports wildcards (*). Defaults to the index.query.default_field index setting, which has a default value of *.

      • default_operator string

        Default boolean logic used to interpret text in the query string if no operators are specified.

        Values are and, AND, or, or OR.

      • enable_position_increments boolean

        If true, enable position increments in queries constructed from a query_string search.

        Default value is true.

      • escape boolean

        Default value is false.

      • fields array[string]

        Array of fields to search. Supports wildcards (*).

      • fuzziness
      • fuzzy_max_expansions number

        Maximum number of terms to which the query expands for fuzzy matching.

        Default value is 50.0.

      • fuzzy_prefix_length number

        Number of beginning characters left unchanged for fuzzy matching.

        Default value is 0.0.

      • fuzzy_rewrite string

        Method used to rewrite the query.

      • fuzzy_transpositions boolean

        If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba).

        Default value is true.

      • lenient boolean

        If true, format-based errors, such as providing a text value for a numeric field, are ignored.

        Default value is false.

      • max_determinized_states number

        Maximum number of automaton states required for the query.

        Default value is 10000.0.

      • minimum_should_match
      • phrase_slop number

        Maximum number of positions allowed between matching tokens for phrases.

        Default value is 0.0.

      • query string Required

        Query string you wish to parse and use for search.

      • quote_analyzer string

        Analyzer used to convert quoted text in the query string into tokens. For quoted text, this parameter overrides the analyzer specified in the analyzer parameter.

      • quote_field_suffix string

        Suffix appended to quoted text in the query string. You can use this suffix to use a different analysis method for exact matches.

      • rewrite string

        Method used to rewrite the query.

      • tie_breaker number

        How to combine the queries generated from the individual search terms in the resulting dis_max query.

      • time_zone string

        Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC.

      • type string

        Determines how the query matches and scores documents.

        Values are best_fields, most_fields, cross_fields, phrase, phrase_prefix, or bool_prefix.

    • range object

      Returns documents that contain terms within a provided range.

      External documentation
    • rank_feature object

      Boosts the relevance score of documents based on the numeric value of a rank_feature or rank_features field.

      External documentation
      Hide rank_feature attributes Show rank_feature attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        rank_feature or rank_features field used to boost relevance scores.

    • regexp object

      Returns documents that contain terms matching a regular expression.

      External documentation
    • rule object
      Hide rule attributes Show rule attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • organic object Required

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

      • ruleset_ids string | array[string]

      • ruleset_id string
      • match_criteria object Required
    • script object

      Filters documents based on a provided script. The script query is typically used in a filter context.

      External documentation
      Hide script attributes Show script attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • script object Required

        Contains a script to run as a query. This script must return a boolean value, true or false.

    • script_score object

      Uses a script to provide a custom score for returned documents.

      External documentation
      Hide script_score attributes Show script_score attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • min_score number

        Documents with a score lower than this floating point number are excluded from the search results.

      • query object Required

        Query used to return documents.

      • script object Required

        Script used to compute the score of documents returned by the query. Important: final relevance scores from the script_score query cannot be negative.

    • semantic object Generally available; Added in 8.15.0

      A semantic query to semantic_text field types

      Hide semantic attributes Show semantic attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        The field to query, which must be a semantic_text field type

      • query string Required

        The query text

    • shape object

      Queries documents that contain fields indexed using the shape type.

      External documentation
      Hide shape attributes Show shape attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        When set to true the query ignores an unmapped field and will not match any documents.

    • simple_query_string object

      Returns documents based on a provided query string, using a parser with a limited but fault-tolerant syntax.

      External documentation
      Hide simple_query_string attributes Show simple_query_string attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • analyzer string

        Analyzer used to convert text in the query string into tokens.

      • analyze_wildcard boolean

        If true, the query attempts to analyze wildcard terms in the query string.

        Default value is false.

      • auto_generate_synonyms_phrase_query boolean

        If true, the parser creates a match_phrase query for each multi-position token.

        Default value is true.

      • default_operator string

        Default boolean logic used to interpret text in the query string if no operators are specified.

        Values are and, AND, or, or OR.

      • fields array[string]

        Array of fields you wish to search. Accepts wildcard expressions. You also can boost relevance scores for matches to particular fields using a caret (^) notation. Defaults to the index.query.default_field index setting, which has a default value of *.

      • fuzzy_max_expansions number

        Maximum number of terms to which the query expands for fuzzy matching.

        Default value is 50.0.

      • fuzzy_prefix_length number

        Number of beginning characters left unchanged for fuzzy matching.

        Default value is 0.0.

      • fuzzy_transpositions boolean

        If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba).

      • lenient boolean

        If true, format-based errors, such as providing a text value for a numeric field, are ignored.

        Default value is false.

      • minimum_should_match
      • query string Required

        Query string in the simple query string syntax you wish to parse and use for search.

      • quote_field_suffix string

        Suffix appended to quoted text in the query string.

    • span_containing object

      Returns matches which enclose another span query.

      External documentation
      Hide span_containing attributes Show span_containing attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • big object Required

        Can be any span query. Matching spans from big that contain matches from little are returned.

      • little object Required

        Can be any span query. Matching spans from big that contain matches from little are returned.

    • span_field_masking object

      Wrapper to allow span queries to participate in composite single-field span queries by lying about their search field.

      External documentation
      Hide span_field_masking attributes Show span_field_masking attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • query object Required
    • span_first object

      Matches spans near the beginning of a field.

      External documentation
      Hide span_first attributes Show span_first attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • end number Required

        Controls the maximum end position permitted in a match.

      • match object Required

        Can be any other span type query.

    • span_multi object

      Allows you to wrap a multi term query (one of wildcard, fuzzy, prefix, range, or regexp query) as a span query, so it can be nested.

      External documentation
      Hide span_multi attributes Show span_multi attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • match object Required

        Should be a multi term query (one of wildcard, fuzzy, prefix, range, or regexp query).

    • span_near object

      Matches spans which are near one another. You can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order.

      External documentation
      Hide span_near attributes Show span_near attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • clauses array[object] Required

        Array of one or more other span type queries.

      • in_order boolean

        Controls whether matches are required to be in-order.

      • slop number

        Controls the maximum number of intervening unmatched positions permitted.

    • span_not object

      Removes matches which overlap with another span query or which are within x tokens before (controlled by the parameter pre) or y tokens after (controlled by the parameter post) another span query.

      External documentation
      Hide span_not attributes Show span_not attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • dist number

        The number of tokens from within the include span that can’t have overlap with the exclude span. Equivalent to setting both pre and post.

      • exclude object Required

        Span query whose matches must not overlap those returned.

      • include object Required

        Span query whose matches are filtered.

      • post number

        The number of tokens after the include span that can’t have overlap with the exclude span.

        Default value is 0.0.

      • pre number

        The number of tokens before the include span that can’t have overlap with the exclude span.

        Default value is 0.0.

    • span_or object

      Matches the union of its span clauses.

      External documentation
      Hide span_or attributes Show span_or attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • clauses array[object] Required

        Array of one or more other span type queries.

    • span_term object

      Matches spans containing a term.

      External documentation
    • span_within object

      Returns matches which are enclosed inside another span query.

      External documentation
      Hide span_within attributes Show span_within attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • big object Required

        Can be any span query. Matching spans from little that are enclosed within big are returned.

      • little object Required

        Can be any span query. Matching spans from little that are enclosed within big are returned.

    • sparse_vector object Generally available; Added in 8.15.0

      Using input query vectors or a natural language processing model to convert a query into a list of token-weight pairs, queries against a sparse vector field.

      External documentation
      Hide sparse_vector attributes Show sparse_vector attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • query string

        The query text you want to use for search. If inference_id is specified, query must also be specified.

      • prune boolean Generally available; Added in 8.15.0

        Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance. If prune is true but the pruning_config is not specified, pruning will occur but default values will be used. Default: false

      • query_vector object

        Dictionary of precomputed sparse vectors and their associated weights. Only one of inference_id or query_vector may be supplied in a request.

    • term object

      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.

      External documentation
    • terms object

      Returns documents that contain one or more exact terms in a provided field. To return a document, one or more terms must exactly match a field value, including whitespace and capitalization.

      External documentation
      Hide terms attributes Show terms attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
    • terms_set object

      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.

      External documentation
    • text_expansion object Deprecated Generally available; Added in 8.8.0

      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.

      External documentation
    • weighted_tokens object Deprecated Generally available; Added in 8.13.0

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

      External documentation
    • wildcard object

      Returns documents that contain terms matching a wildcard pattern.

      External documentation
    • wrapper object

      A query that accepts any other query as base64 encoded string.

      External documentation
      Hide wrapper attributes Show wrapper attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • query string Required

        A base64 encoded query. The binary data format can be any of JSON, YAML, CBOR or SMILE encodings

    • type object
      Hide type attributes Show type attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • value string Required
  • profile boolean
  • query object

    Defines the search definition using the Query DSL.

    External documentation
    Hide query attributes Show query attributes object
    • bool object

      matches documents matching boolean combinations of other queries.

      External documentation
      Hide bool attributes Show bool attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • filter object | array[object]

        The clause (query) must appear in matching documents. However, unlike must, the score of the query will be ignored.

        One of:

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

      • minimum_should_match
      • must object | array[object]

        The clause (query) must appear in matching documents and will contribute to the score.

        One of:

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

      • must_not object | array[object]

        The clause (query) must not appear in the matching documents. Because scoring is ignored, a score of 0 is returned for all documents.

        One of:

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

      • should object | array[object]

        The clause (query) should appear in the matching document.

        One of:

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

    • boosting object

      Returns documents matching a positive query while reducing the relevance score of documents that also match a negative query.

      External documentation
      Hide boosting attributes Show boosting attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • negative_boost number Required

        Floating point number between 0 and 1.0 used to decrease the relevance scores of documents matching the negative query.

      • negative object Required

        Query used to decrease the relevance score of matching documents.

      • positive object Required

        Any returned documents must match this query.

    • common object Deprecated
    • combined_fields object Generally available; Added in 7.13.0

      The combined_fields query supports searching multiple text fields as if their contents had been indexed into one combined field.

      External documentation
      Hide combined_fields attributes Show combined_fields attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • fields array[string] Required

        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 string Required

        Text to search for in the provided fields. The combined_fields query analyzes the provided text before performing a search.

      • auto_generate_synonyms_phrase_query boolean

        If true, match phrase queries are automatically created for multi-term synonyms.

        Default value is true.

      • operator string

        Boolean logic used to interpret text in the query value.

        Values are or or and.

      • minimum_should_match
      • zero_terms_query string

        Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter.

        Values are none or all.

    • constant_score object

      Wraps a filter query and returns every matching document with a relevance score equal to the boost parameter value.

      External documentation
      Hide constant_score attributes Show constant_score attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • filter object Required

        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.

    • dis_max object

      Returns documents matching one or more wrapped queries, called query clauses or clauses. If a returned document matches multiple query clauses, the dis_max query assigns the document the highest relevance score from any matching clause, plus a tie breaking increment for any additional matching subqueries.

      External documentation
      Hide dis_max attributes Show dis_max attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • queries array[object] Required

        One or more query clauses. Returned documents must match one or more of these queries. If a document matches multiple queries, Elasticsearch uses the highest relevance score.

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

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

      • tie_breaker number

        Floating point number between 0 and 1.0 used to increase the relevance scores of documents matching multiple query clauses.

        Default value is 0.0.

    • distance_feature object Required

      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.

      External documentation
    • exists object

      Returns documents that contain an indexed value for a field.

      External documentation
      Hide exists attributes Show exists attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        Name of the field you wish to search.

    • function_score object

      The function_score enables you to modify the score of documents that are retrieved by a query.

      External documentation
      Hide function_score attributes Show function_score attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • boost_mode string

        Defines how he newly computed score is combined with the score of the query

        Values are multiply, replace, sum, avg, max, or min.

      • functions array[object]

        One or more functions that compute a new score for each document returned by the query.

      • max_boost number

        Restricts the new score to not exceed the provided limit.

      • min_score number

        Excludes documents that do not meet the provided score threshold.

      • query object

        A query that determines the documents for which a new score is computed.

      • score_mode string

        Specifies how the computed scores are combined

        Values are multiply, sum, avg, first, max, or min.

    • fuzzy object

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

      External documentation
    • geo_bounding_box object

      Matches geo_point and geo_shape values that intersect a bounding box.

      External documentation
      Hide geo_bounding_box attributes Show geo_bounding_box attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • type string

        Values are memory or indexed.

      • validation_method string

        Set to IGNORE_MALFORMED to accept geo points with invalid latitude or longitude. Set to COERCE to also try to infer correct latitude or longitude.

        Values are coerce, ignore_malformed, or strict.

      • ignore_unmapped boolean

        Set to true to ignore an unmapped field and not match any documents for this query. Set to false to throw an exception if the field is not mapped.

        Default value is false.

    • geo_distance object

      Matches geo_point and geo_shape values within a given distance of a geopoint.

      External documentation
      Hide geo_distance attributes Show geo_distance attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • distance string Required

        The radius of the circle centred on the specified location. Points which fall into this circle are considered to be matches.

      • distance_type string

        How to compute the distance. Set to plane for a faster calculation that's inaccurate on long distances and close to the poles.

        Values are arc or plane.

      • validation_method string

        Set to IGNORE_MALFORMED to accept geo points with invalid latitude or longitude. Set to COERCE to also try to infer correct latitude or longitude.

        Values are coerce, ignore_malformed, or strict.

      • ignore_unmapped boolean

        Set to true to ignore an unmapped field and not match any documents for this query. Set to false to throw an exception if the field is not mapped.

        Default value is false.

    • geo_grid object

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

    • geo_polygon object
      Hide geo_polygon attributes Show geo_polygon attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • validation_method string

        Values are coerce, ignore_malformed, or strict.

      • ignore_unmapped boolean
    • geo_shape object

      Filter documents indexed using either the geo_shape or the geo_point type.

      External documentation
      Hide geo_shape attributes Show geo_shape attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Set to true to ignore an unmapped field and not match any documents for this query. Set to false to throw an exception if the field is not mapped.

        Default value is false.

    • has_child object

      Returns parent documents whose joined child documents match a provided query.

      External documentation
      Hide has_child attributes Show has_child attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped type and not return any documents instead of an error.

        Default value is false.

      • inner_hits object

        If defined, each search hit will contain inner hits.

      • max_children number

        Maximum number of child documents that match the query allowed for a returned parent document. If the parent document exceeds this limit, it is excluded from the search results.

      • min_children number

        Minimum number of child documents that match the query required to match the query for a returned parent document. If the parent document does not meet this limit, it is excluded from the search results.

      • query object Required

        Query you wish to run on child documents of the type field. If a child document matches the search, the query returns the parent document.

      • score_mode string

        Indicates how scores for matching child documents affect the root parent document’s relevance score.

        Values are none, avg, sum, max, or min.

      • type string Required

        Name of the child relationship mapped for the join field.

    • has_parent object

      Returns child documents whose joined parent document matches a provided query.

      External documentation
      Hide has_parent attributes Show has_parent attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped parent_type and not return any documents instead of an error. You can use this parameter to query multiple indices that may not contain the parent_type.

        Default value is false.

      • inner_hits object

        If defined, each search hit will contain inner hits.

      • parent_type string Required

        Name of the parent relationship mapped for the join field.

      • query object Required

        Query you wish to run on parent documents of the parent_type field. If a parent document matches the search, the query returns its child documents.

      • score boolean

        Indicates whether the relevance score of a matching parent document is aggregated into its child documents.

        Default value is false.

    • ids object

      Returns documents based on their IDs. This query uses document IDs stored in the _id field.

      External documentation
      Hide ids attributes Show ids attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • values
    • intervals object

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

      External documentation
    • knn object

      Finds the k nearest vectors to a query vector, as measured by a similarity metric. knn query finds nearest vectors through approximate search on indexed dense_vectors.

      External documentation
      Hide knn attributes Show knn attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        The name of the vector field to search against

      • query_vector array[number]

        The query vector

      • query_vector_builder object

        The query vector builder. You must provide a query_vector_builder or query_vector, but not both.

      • num_candidates number

        The number of nearest neighbor candidates to consider per shard

      • visit_percentage number Generally available; Added in 9.2.0

        The percentage of vectors to explore per shard while doing knn search with bbq_disk

      • k number

        The final number of nearest neighbors to return as top hits

      • filter object | array[object]

        Filters for the kNN search query

        One of:

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

      • similarity number

        The minimum similarity for a vector to be considered a match

      • rescore_vector object

        Apply oversampling and rescoring to quantized vectors

    • match object

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

      External documentation
    • match_all object

      Matches all documents, giving them all a _score of 1.0.

      External documentation
      Hide match_all attributes Show match_all attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
    • match_bool_prefix object

      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.

      External documentation
    • match_none object

      Matches no documents.

      External documentation
      Hide match_none attributes Show match_none attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
    • match_phrase object

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

      External documentation
    • match_phrase_prefix object

      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.

      External documentation
    • more_like_this object

      Returns documents that are "like" a given set of documents.

      External documentation
      Hide more_like_this attributes Show more_like_this attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • analyzer string

        The analyzer that is used to analyze the free form text. Defaults to the analyzer associated with the first field in fields.

        External documentation
      • boost_terms number

        Each term in the formed query could be further boosted by their tf-idf score. This sets the boost factor to use when using this feature. Defaults to deactivated (0).

        Default value is 0.0.

      • fail_on_unsupported_field boolean

        Controls whether the query should fail (throw an exception) if any of the specified fields are not of the supported types (text or keyword).

        Default value is true.

      • fields array[string]

        A list of fields to fetch and analyze the text from. Defaults to the index.query.default_field index setting, which has a default value of *.

      • include boolean

        Specifies whether the input documents should also be included in the search results returned.

        Default value is false.

      • like array[string | object] Required
      • max_doc_freq number

        The maximum document frequency above which the terms are ignored from the input document.

      • max_query_terms number

        The maximum number of query terms that can be selected.

        Default value is 25.0.

      • max_word_length number

        The maximum word length above which the terms are ignored. Defaults to unbounded (0).

        Default value is 0.0.

      • min_doc_freq number

        The minimum document frequency below which the terms are ignored from the input document.

        Default value is 5.0.

      • minimum_should_match
      • min_term_freq number

        The minimum term frequency below which the terms are ignored from the input document.

        Default value is 2.0.

      • min_word_length number

        The minimum word length below which the terms are ignored.

        Default value is 0.0.

      • routing string
      • stop_words
      • unlike array[string | object]
      • version number
      • version_type string

        Values are internal, external, or external_gte.

    • multi_match object

      Enables you to search for a provided text, number, date or boolean value across multiple fields. The provided text is analyzed before matching.

      External documentation
      Hide multi_match attributes Show multi_match attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • analyzer string

        Analyzer used to convert the text in the query value into tokens.

      • auto_generate_synonyms_phrase_query boolean

        If true, match phrase queries are automatically created for multi-term synonyms.

        Default value is true.

      • cutoff_frequency number Deprecated
      • fields string | array[string]

        The fields to be queried. Defaults to the index.query.default_field index settings, which in turn defaults to *.

      • fuzziness
      • fuzzy_rewrite string

        Method used to rewrite the query.

      • fuzzy_transpositions boolean

        If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba). Can be applied to the term subqueries constructed for all terms but the final term.

        Default value is true.

      • lenient boolean

        If true, format-based errors, such as providing a text query value for a numeric field, are ignored.

        Default value is false.

      • max_expansions number

        Maximum number of terms to which the query will expand.

        Default value is 50.0.

      • minimum_should_match
      • operator string

        Boolean logic used to interpret text in the query value.

        Values are and, AND, or, or OR.

      • prefix_length number

        Number of beginning characters left unchanged for fuzzy matching.

        Default value is 0.0.

      • query string Required

        Text, number, boolean value or date you wish to find in the provided field.

      • slop number

        Maximum number of positions allowed between matching tokens.

        Default value is 0.0.

      • tie_breaker number

        Determines how scores for each per-term blended query and scores across groups are combined.

        Default value is 0.0.

      • type string

        How the multi_match query is executed internally.

        Values are best_fields, most_fields, cross_fields, phrase, phrase_prefix, or bool_prefix.

      • zero_terms_query string

        Indicates whether no documents are returned if the analyzer removes all tokens, such as when using a stop filter.

        Values are all or none.

    • nested object

      Wraps another query to search nested fields. If an object matches the search, the nested query returns the root parent document.

      External documentation
      Hide nested attributes Show nested attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped path and not return any documents instead of an error.

        Default value is false.

      • inner_hits object

        If defined, each search hit will contain inner hits.

      • path string Required

        Path to the nested object you wish to search.

      • query object Required

        Query you wish to run on nested objects in the path.

      • score_mode string

        How scores for matching child objects affect the root parent document’s relevance score.

        Values are none, avg, sum, max, or min.

    • parent_id object

      Returns child documents joined to a specific parent document.

      External documentation
      Hide parent_id attributes Show parent_id attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • id string

        ID of the parent document.

      • ignore_unmapped boolean

        Indicates whether to ignore an unmapped type and not return any documents instead of an error.

        Default value is false.

      • type string

        Name of the child relationship mapped for the join field.

    • percolate object

      Matches queries stored in an index.

      External documentation
      Hide percolate attributes Show percolate attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • document object

        The source of the document being percolated.

      • documents array[object]

        An array of sources of the documents being percolated.

      • field string Required

        Field that holds the indexed queries. The field must use the percolator mapping type.

      • id string

        The ID of a stored document to percolate.

      • index string

        The index of a stored document to percolate.

      • name string

        The suffix used for the _percolator_document_slot field when multiple percolate queries are specified.

      • preference string

        Preference used to fetch document to percolate.

      • routing string

        Routing used to fetch document to percolate.

      • version number

        The expected version of a stored document to percolate.

    • pinned object

      Promotes selected documents to rank higher than those matching a given query.

      External documentation
      Hide pinned attributes Show pinned attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ids array[string]

        Document IDs listed in the order they are to appear in results. Required if docs is not specified.

      • docs array[object]

        Documents listed in the order they are to appear in results. Required if ids is not specified.

    • prefix object

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

      External documentation
    • query_string object

      Returns documents based on a provided query string, using a parser with a strict syntax.

      External documentation
      Hide query_string attributes Show query_string attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • allow_leading_wildcard boolean

        If true, the wildcard characters * and ? are allowed as the first character of the query string.

        Default value is true.

      • analyzer string

        Analyzer used to convert text in the query string into tokens.

      • analyze_wildcard boolean

        If true, the query attempts to analyze wildcard terms in the query string.

        Default value is false.

      • auto_generate_synonyms_phrase_query boolean

        If true, match phrase queries are automatically created for multi-term synonyms.

        Default value is true.

      • default_field string

        Default field to search if no field is provided in the query string. Supports wildcards (*). Defaults to the index.query.default_field index setting, which has a default value of *.

      • default_operator string

        Default boolean logic used to interpret text in the query string if no operators are specified.

        Values are and, AND, or, or OR.

      • enable_position_increments boolean

        If true, enable position increments in queries constructed from a query_string search.

        Default value is true.

      • escape boolean

        Default value is false.

      • fields array[string]

        Array of fields to search. Supports wildcards (*).

      • fuzziness
      • fuzzy_max_expansions number

        Maximum number of terms to which the query expands for fuzzy matching.

        Default value is 50.0.

      • fuzzy_prefix_length number

        Number of beginning characters left unchanged for fuzzy matching.

        Default value is 0.0.

      • fuzzy_rewrite string

        Method used to rewrite the query.

      • fuzzy_transpositions boolean

        If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba).

        Default value is true.

      • lenient boolean

        If true, format-based errors, such as providing a text value for a numeric field, are ignored.

        Default value is false.

      • max_determinized_states number

        Maximum number of automaton states required for the query.

        Default value is 10000.0.

      • minimum_should_match
      • phrase_slop number

        Maximum number of positions allowed between matching tokens for phrases.

        Default value is 0.0.

      • query string Required

        Query string you wish to parse and use for search.

      • quote_analyzer string

        Analyzer used to convert quoted text in the query string into tokens. For quoted text, this parameter overrides the analyzer specified in the analyzer parameter.

      • quote_field_suffix string

        Suffix appended to quoted text in the query string. You can use this suffix to use a different analysis method for exact matches.

      • rewrite string

        Method used to rewrite the query.

      • tie_breaker number

        How to combine the queries generated from the individual search terms in the resulting dis_max query.

      • time_zone string

        Coordinated Universal Time (UTC) offset or IANA time zone used to convert date values in the query string to UTC.

      • type string

        Determines how the query matches and scores documents.

        Values are best_fields, most_fields, cross_fields, phrase, phrase_prefix, or bool_prefix.

    • range object

      Returns documents that contain terms within a provided range.

      External documentation
    • rank_feature object

      Boosts the relevance score of documents based on the numeric value of a rank_feature or rank_features field.

      External documentation
      Hide rank_feature attributes Show rank_feature attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        rank_feature or rank_features field used to boost relevance scores.

    • regexp object

      Returns documents that contain terms matching a regular expression.

      External documentation
    • rule object
      Hide rule attributes Show rule attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • organic object Required

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

      • ruleset_ids string | array[string]

      • ruleset_id string
      • match_criteria object Required
    • script object

      Filters documents based on a provided script. The script query is typically used in a filter context.

      External documentation
      Hide script attributes Show script attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • script object Required

        Contains a script to run as a query. This script must return a boolean value, true or false.

    • script_score object

      Uses a script to provide a custom score for returned documents.

      External documentation
      Hide script_score attributes Show script_score attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • min_score number

        Documents with a score lower than this floating point number are excluded from the search results.

      • query object Required

        Query used to return documents.

      • script object Required

        Script used to compute the score of documents returned by the query. Important: final relevance scores from the script_score query cannot be negative.

    • semantic object Generally available; Added in 8.15.0

      A semantic query to semantic_text field types

      Hide semantic attributes Show semantic attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        The field to query, which must be a semantic_text field type

      • query string Required

        The query text

    • shape object

      Queries documents that contain fields indexed using the shape type.

      External documentation
      Hide shape attributes Show shape attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • ignore_unmapped boolean

        When set to true the query ignores an unmapped field and will not match any documents.

    • simple_query_string object

      Returns documents based on a provided query string, using a parser with a limited but fault-tolerant syntax.

      External documentation
      Hide simple_query_string attributes Show simple_query_string attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • analyzer string

        Analyzer used to convert text in the query string into tokens.

      • analyze_wildcard boolean

        If true, the query attempts to analyze wildcard terms in the query string.

        Default value is false.

      • auto_generate_synonyms_phrase_query boolean

        If true, the parser creates a match_phrase query for each multi-position token.

        Default value is true.

      • default_operator string

        Default boolean logic used to interpret text in the query string if no operators are specified.

        Values are and, AND, or, or OR.

      • fields array[string]

        Array of fields you wish to search. Accepts wildcard expressions. You also can boost relevance scores for matches to particular fields using a caret (^) notation. Defaults to the index.query.default_field index setting, which has a default value of *.

      • fuzzy_max_expansions number

        Maximum number of terms to which the query expands for fuzzy matching.

        Default value is 50.0.

      • fuzzy_prefix_length number

        Number of beginning characters left unchanged for fuzzy matching.

        Default value is 0.0.

      • fuzzy_transpositions boolean

        If true, edits for fuzzy matching include transpositions of two adjacent characters (for example, ab to ba).

      • lenient boolean

        If true, format-based errors, such as providing a text value for a numeric field, are ignored.

        Default value is false.

      • minimum_should_match
      • query string Required

        Query string in the simple query string syntax you wish to parse and use for search.

      • quote_field_suffix string

        Suffix appended to quoted text in the query string.

    • span_containing object

      Returns matches which enclose another span query.

      External documentation
      Hide span_containing attributes Show span_containing attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • big object Required

        Can be any span query. Matching spans from big that contain matches from little are returned.

      • little object Required

        Can be any span query. Matching spans from big that contain matches from little are returned.

    • span_field_masking object

      Wrapper to allow span queries to participate in composite single-field span queries by lying about their search field.

      External documentation
      Hide span_field_masking attributes Show span_field_masking attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • field string Required

        Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • query object Required
    • span_first object

      Matches spans near the beginning of a field.

      External documentation
      Hide span_first attributes Show span_first attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • end number Required

        Controls the maximum end position permitted in a match.

      • match object Required

        Can be any other span type query.

    • span_multi object

      Allows you to wrap a multi term query (one of wildcard, fuzzy, prefix, range, or regexp query) as a span query, so it can be nested.

      External documentation
      Hide span_multi attributes Show span_multi attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • match object Required

        Should be a multi term query (one of wildcard, fuzzy, prefix, range, or regexp query).

    • span_near object

      Matches spans which are near one another. You can specify slop, the maximum number of intervening unmatched positions, as well as whether matches are required to be in-order.

      External documentation
      Hide span_near attributes Show span_near attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • clauses array[object] Required

        Array of one or more other span type queries.

      • in_order boolean

        Controls whether matches are required to be in-order.

      • slop number

        Controls the maximum number of intervening unmatched positions permitted.

    • span_not object

      Removes matches which overlap with another span query or which are within x tokens before (controlled by the parameter pre) or y tokens after (controlled by the parameter post) another span query.

      External documentation
      Hide span_not attributes Show span_not attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • dist number

        The number of tokens from within the include span that can’t have overlap with the exclude span. Equivalent to setting both pre and post.

      • exclude object Required

        Span query whose matches must not overlap those returned.

      • include object Required

        Span query whose matches are filtered.

      • post number

        The number of tokens after the include span that can’t have overlap with the exclude span.

        Default value is 0.0.

      • pre number

        The number of tokens before the include span that can’t have overlap with the exclude span.

        Default value is 0.0.

    • span_or object

      Matches the union of its span clauses.

      External documentation
      Hide span_or attributes Show span_or attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • clauses array[object] Required

        Array of one or more other span type queries.

    • span_term object

      Matches spans containing a term.

      External documentation
    • span_within object

      Returns matches which are enclosed inside another span query.

      External documentation
      Hide span_within attributes Show span_within attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • big object Required

        Can be any span query. Matching spans from little that are enclosed within big are returned.

      • little object Required

        Can be any span query. Matching spans from little that are enclosed within big are returned.

    • sparse_vector object Generally available; Added in 8.15.0

      Using input query vectors or a natural language processing model to convert a query into a list of token-weight pairs, queries against a sparse vector field.

      External documentation
      Hide sparse_vector attributes Show sparse_vector attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • query string

        The query text you want to use for search. If inference_id is specified, query must also be specified.

      • prune boolean Generally available; Added in 8.15.0

        Whether to perform pruning, omitting the non-significant tokens from the query to improve query performance. If prune is true but the pruning_config is not specified, pruning will occur but default values will be used. Default: false

      • query_vector object

        Dictionary of precomputed sparse vectors and their associated weights. Only one of inference_id or query_vector may be supplied in a request.

    • term object

      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.

      External documentation
    • terms object

      Returns documents that contain one or more exact terms in a provided field. To return a document, one or more terms must exactly match a field value, including whitespace and capitalization.

      External documentation
      Hide terms attributes Show terms attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
    • terms_set object

      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.

      External documentation
    • text_expansion object Deprecated Generally available; Added in 8.8.0

      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.

      External documentation
    • weighted_tokens object Deprecated Generally available; Added in 8.13.0

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

      External documentation
    • wildcard object

      Returns documents that contain terms matching a wildcard pattern.

      External documentation
    • wrapper object

      A query that accepts any other query as base64 encoded string.

      External documentation
      Hide wrapper attributes Show wrapper attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • query string Required

        A base64 encoded query. The binary data format can be any of JSON, YAML, CBOR or SMILE encodings

    • type object
      Hide type attributes Show type attributes object
      • boost number

        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.

        Default value is 1.0.

      • _name string
      • value string Required
  • rescore object | array[object]

    One of:
    Hide attributes Show attributes object
    • window_size number
    • query object
      Hide query attributes Show query attributes object
      • query_weight number

        Relative importance of the original query versus the rescore query.

        Default value is 1.0.

      • rescore_query_weight number

        Relative importance of the rescore query versus the original query.

        Default value is 1.0.

    • learning_to_rank object
      Hide learning_to_rank attributes Show learning_to_rank attributes object
      • model_id string Required

        The unique identifier of the trained model uploaded to Elasticsearch

      • params object

        Named parameters to be passed to the query templates used for feature

    • script object
  • script_fields object

    Retrieve a script evaluation (based on different fields) for each hit.

    Hide script_fields attribute Show script_fields attribute object
    • * object Additional properties
      Hide * attributes Show * attributes object
      • script object Required
        Hide script attributes Show script attributes object
        • source string | object

          The script source.

        • id string

          The id for a stored script.

        • params object

          Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

          Hide params attribute Show params attribute object
          • * object Additional properties
        • lang string

          Specifies the language the script is written in.

          Any of:

          Values are painless, expression, mustache, or java.

        • options object
          Hide options attribute Show options attribute object
          • * string Additional properties
      • ignore_failure boolean
  • search_after array[number | string | boolean | null]

    A field value.

  • size number

    The number of hits to return. By default, you cannot page through more than 10,000 hits using the from and size parameters. To page through more hits, use the search_after parameter.

    Default value is 10.0.

  • slice object
    Hide slice attributes Show slice attributes object
    • field string

      Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

    • id string Required
    • max number Required
  • sort string | object | array[string | object]

    One of:

    Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

  • _source boolean | object

    Indicates which source fields are returned for matching documents. These fields are returned in the hits._source property of the search response.

    One of:
  • fields array[object]

    Array of wildcard (*) patterns. The request returns values for field names matching these patterns in the hits.fields property of the response.

    Hide fields attributes Show fields attributes object

    A reference to a field with formatting instructions on how to return the value

    • field string Required

      A wildcard pattern. The request returns values for field names matching this pattern.

    • format string

      The format in which the values are returned.

    • include_unmapped boolean
  • suggest object
    Hide suggest attribute Show suggest attribute object
    • text string

      Global suggest text, to avoid repetition when the same text is used in several suggesters

  • terminate_after number

    Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Defaults to 0, which does not terminate query execution early.

    Default value is 0.0.

  • timeout string

    Specifies the period of time to wait for a response from each shard. If no response is received before the timeout expires, the request fails and returns an error. Defaults to no timeout.

  • track_scores boolean

    If true, calculate and return document scores, even if the scores are not used for sorting.

    Default value is false.

  • version boolean

    If true, returns document version as part of a hit.

    Default value is false.

  • seq_no_primary_term boolean

    If true, returns sequence number and primary term of the last modification of each hit. See Optimistic concurrency control.

  • stored_fields string | array[string]

    List of stored fields to return as part of a hit. If no fields are specified, no stored fields are included in the response. If this field is specified, the _source parameter defaults to false. You can pass _source: true to return both source fields and stored fields in the search response.

  • pit object

    Limits the search to a point in time (PIT). If you provide a PIT, you cannot specify an in the request path.

    Hide pit attributes Show pit attributes object
    • id string Required
    • keep_alive string

      A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

      External documentation
  • runtime_mappings object

    Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

    Hide runtime_mappings attribute Show runtime_mappings attribute object
    • * object Additional properties
      Hide * attributes Show * attributes object
      • fields object

        For type composite

        Hide fields attribute Show fields attribute object
        • * object Additional properties
          Hide * attribute Show * attribute object
          • type string Required

            Values are boolean, composite, date, double, geo_point, geo_shape, ip, keyword, long, or lookup.

      • fetch_fields array[object]

        For type lookup

        Hide fetch_fields attributes Show fetch_fields attributes object
        • field string Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

        • format string
      • format string

        A custom format for date type runtime fields.

      • input_field string

        For type lookup

      • target_field string

        For type lookup

      • target_index string

        For type lookup

      • script object

        Painless script executed at query time.

        Hide script attributes Show script attributes object
        • source
        • id string

          The id for a stored script.

        • params object

          Specifies any named parameters that are passed into the script as variables. Use parameters instead of hard-coded values to decrease compile time.

          Hide params attribute Show params attribute object
          • * object Additional properties
        • lang
        • options object
          Hide options attribute Show options attribute object
          • * string Additional properties
      • type string Required

        Field type, which can be: boolean, composite, date, double, geo_point, ip,keyword, long, or lookup.

        Values are boolean, composite, date, double, geo_point, geo_shape, ip, keyword, long, or lookup.

  • stats array[string]

    Stats groups to associate with the search. Each group maintains a statistics aggregation for its associated searches. You can retrieve these stats using the indices stats API.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • id string
    • is_partial boolean Required

      When the query is no longer running, this property indicates whether the search failed or was successfully completed on all shards. While the query is running, is_partial is always set to true.

    • is_running boolean Required

      Indicates whether the search is still running or has completed.


      If the search failed after some shards returned their results or the node that is coordinating the async search dies, results may be partial even though is_running is false.

    • expiration_time string | number

      Indicates when the async search will expire.

      One of:

      Time unit for milliseconds

    • expiration_time_in_millis number

      Time unit for milliseconds

    • start_time string | number

      One of:

      Time unit for milliseconds

    • start_time_in_millis number

      Time unit for milliseconds

    • completion_time string | number

      Indicates when the async search completed. It is present only when the search has completed.

      One of:

      Time unit for milliseconds

    • completion_time_in_millis number

      Time unit for milliseconds

    • error object

      Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

      Hide error attributes Show error attributes object
      • type string Required

        The type of error

      • reason string | null

        A human-readable explanation of the error, in English.

      • stack_trace string

        The server stack trace. Present only if the error_trace=true parameter was sent with the request.

      • caused_by object

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

      • root_cause array[object]

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

      • suppressed array[object]

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

        Cause and details about a request failure. This class defines the properties common to all error types. Additional details are also provided, that depend on the error type.

    • response object Required
      Hide response attributes Show response attributes object
      • aggregations object

        Partial aggregations results, coming from the shards that have already completed running the query.

      • _clusters object
        Hide _clusters attributes Show _clusters attributes object
        • skipped number Required
        • successful number Required
        • total number Required
        • running number Required
        • partial number Required
        • failed number Required
        • details object
      • fields object
        Hide fields attribute Show fields attribute object
        • * object Additional properties
      • hits object Required
        Hide hits attributes Show hits attributes object
        • total
        • hits array[object] Required
        • max_score
      • max_score number
      • num_reduce_phases number

        Indicates how many reductions of the results have been performed. If this number increases compared to the last retrieved results for a get asynch search request, you can expect additional results included in the search response.

      • profile object
        Hide profile attribute Show profile attribute object
        • shards array[object] Required
      • pit_id string
      • _scroll_id string
      • _shards object Required

        Indicates how many shards have run the query. Note that in order for shard results to be included in the search response, they need to be reduced first.

        Hide _shards attribute Show _shards attribute object
        • failures array[object]
      • suggest object
        Hide suggest attribute Show suggest attribute object
        • * array[object] Additional properties
      • terminated_early boolean
      • timed_out boolean Required
      • took number Required
POST /_async_search
curl \
 --request POST 'http://api.example.com/_async_search' \
 --header "Content-Type: application/json" \
 --data '"{\n  \"sort\": [\n    { \"date\": { \"order\": \"asc\" } }\n  ],\n  \"aggs\": {\n    \"sale_date\": {\n      \"date_histogram\": {\n        \"field\": \"date\",\n        \"calendar_interval\": \"1d\"\n      }\n    }\n  }\n}"'
Request example
Perform a search request asynchronously with `POST /sales*/_async_search?size=0`. It accepts the same parameters and request body as the search API.
{
  "sort": [
    { "date": { "order": "asc" } }
  ],
  "aggs": {
    "sale_date": {
      "date_histogram": {
        "field": "date",
        "calendar_interval": "1d"
      }
    }
  }
}
Response examples (200)
A successful response when performing search asynchronously.
{
  "id" : "FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=",
  "is_partial" : true,
  "is_running" : true,
  "start_time_in_millis" : 1583945890986,
  "expiration_time_in_millis" : 1584377890986,
  "response" : {
    "took" : 1122,
    "timed_out" : false,
    "num_reduce_phases" : 0,
    "_shards" : {
      "total" : 562,
      "successful" : 3,
      "skipped" : 0,
      "failed" : 0
    },
    "hits" : {
      "total" : {
        "value" : 157483,
        "relation" : "gte"
      },
      "max_score" : null,
      "hits" : [ ]
    }
  }
}