﻿---
title: stack es async-search submit cli command
description: Run an async search. Behaviour flags: --dry-run — validate all inputs and exit without performing any action 
url: https://www.elastic.co/elastic/docs-builder/docs/4116/reference/elastic-cli/cli/stack/es/async-search/submit
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack es async-search submit cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack es async-search submit [options]
```

Run an async search.
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--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.
  </definition>
  <definition term="--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.
  </definition>
  <definition term="--keep-on-completion">
    If `true`, results are stored for later retrieval when the search completes within the `wait_for_completion_timeout`.
  </definition>
  <definition term="--allow-no-indices">
    A setting that does two separate checks on the index expression.
    If `false`, the request returns an error (1) if any wildcard expression
    (including `_all` and `*`) resolves to zero matching indices or (2) if the
    complete set of resolved indices, aliases or data streams is empty after all
    expressions are evaluated. If `true`, index expressions that resolve to no
    indices are allowed and the request returns an empty result.
  </definition>
  <definition term="--allow-partial-search-results">
    Indicate if an error should be returned if there is a partial search failure or timeout
  </definition>
  <definition term="--analyzer string">
    The analyzer to use for the query string
  </definition>
  <definition term="--analyze-wildcard">
    Specify whether wildcard and prefix queries should be analyzed
  </definition>
  <definition term="--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).
  </definition>
  <definition term="--ccs-minimize-roundtrips">
    The default value is the only supported value.
  </definition>
  <definition term="--default-operator enum">
    The default operator for query string query (AND or OR)
    **Values:** and, or
  </definition>
  <definition term="--df string">
    The field to use as default where no field prefix is given in the query string
  </definition>
  <definition term="--docvalue-fields string[]">
    Array of wildcard (*) patterns. The request returns doc values for field
    names matching these patterns in the hits.fields property of the response.
    **Repeatable:** pass `--docvalue-fields` multiple times to supply more than one value
  </definition>
  <definition term="--expand-wildcards enum">
    Whether to expand wildcard expression to concrete indices that are open, closed or both
    **Values:** all, open, closed, hidden, none
    **Repeatable:** pass `--expand-wildcards` multiple times to supply more than one value
  </definition>
  <definition term="--explain">
    If true, returns detailed information about score computation as part of a hit.
  </definition>
  <definition term="--ignore-throttled">
    Whether specified concrete, expanded or aliased indices should be ignored when throttled
  </definition>
  <definition term="--ignore-unavailable">
    If `false`, the request returns an error if it targets a concrete (non-wildcarded)
    index, alias, or data stream that is missing, closed, or otherwise unavailable.
    If `true`, unavailable concrete targets are silently ignored.
  </definition>
  <definition term="--lenient">
    Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
  </definition>
  <definition term="--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
  </definition>
  <definition term="--preference string">
    Specify the node or shard the operation should be performed on
  </definition>
  <definition term="--request-cache">
    Specify if request cache should be used for this request or not, defaults to true
  </definition>
  <definition term="--routing string">
    A comma-separated list of specific routing values
    **Repeatable:** pass `--routing` multiple times to supply more than one value
  </definition>
  <definition term="--search-type enum">
    Search operation type
    **Values:** query_then_fetch, dfs_query_then_fetch
  </definition>
  <definition term="--stats 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.
    **Repeatable:** pass `--stats` multiple times to supply more than one value
  </definition>
  <definition term="--stored-fields 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.
    **Repeatable:** pass `--stored-fields` multiple times to supply more than one value
  </definition>
  <definition term="--suggest-field string">
    Specifies which field to use for suggestions.
  </definition>
  <definition term="--suggest-mode enum">
    Specify suggest mode
    **Values:** missing, popular, always
  </definition>
  <definition term="--suggest-size number">
    How many suggestions to return in response
  </definition>
  <definition term="--suggest-text string">
    The source text for which the suggestions should be returned.
  </definition>
  <definition term="--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.
  </definition>
  <definition term="--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.
  </definition>
  <definition term="--track-total-hits 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.
  </definition>
  <definition term="--track-scores">
    If true, calculate and return document scores, even if the scores are not used for sorting.
  </definition>
  <definition term="--typed-keys">
    Specify whether aggregation and suggester names should be prefixed by their respective types in the response
  </definition>
  <definition term="--rest-total-hits-as-int">
    Indicates whether hits.total should be rendered as an integer or an object in the rest search response
  </definition>
  <definition term="--version">
    If true, returns document version as part of a hit.
  </definition>
  <definition term="--source string">
    Indicates which source fields are returned for matching documents. These
    fields are returned in the hits._source property of the search response.
  </definition>
  <definition term="--source-excludes string">
    A list of fields to exclude from the returned _source field
    **Repeatable:** pass `--source-excludes` multiple times to supply more than one value
  </definition>
  <definition term="--source-includes string">
    A list of fields to extract and return from the _source field
    **Repeatable:** pass `--source-includes` multiple times to supply more than one value
  </definition>
  <definition term="--seq-no-primary-term">
    If true, returns sequence number and primary term of the last modification
    of each hit. See Optimistic concurrency control.
  </definition>
  <definition term="--q string">
    Query in the Lucene query string syntax
  </definition>
  <definition term="--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.
  </definition>
  <definition term="--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.
  </definition>
  <definition term="--sort string">
    **Repeatable:** pass `--sort` multiple times to supply more than one value
  </definition>
  <definition term="--aggregations string">
  </definition>
  <definition term="--collapse string">
  </definition>
  <definition term="--ext string">
    Configuration of search extensions defined by Elasticsearch plugins.
  </definition>
  <definition term="--highlight string">
  </definition>
  <definition term="--indices-boost string[]">
    Boosts the _score of documents from specified indices.
    **Repeatable:** pass `--indices-boost` multiple times to supply more than one value
  </definition>
  <definition term="--knn string">
    Defines the approximate kNN search to run.
    **Repeatable:** pass `--knn` multiple times to supply more than one value
  </definition>
  <definition term="--min-score number">
    Minimum _score for matching documents. Documents with a lower _score are
    not included in search results and results collected by aggregations.
  </definition>
  <definition term="--post-filter string">
  </definition>
  <definition term="--profile">
  </definition>
  <definition term="--query string">
    Defines the search definition using the Query DSL.
  </definition>
  <definition term="--rescore string">
    **Repeatable:** pass `--rescore` multiple times to supply more than one value
  </definition>
  <definition term="--script-fields string">
    Retrieve a script evaluation (based on different fields) for each hit.
  </definition>
  <definition term="--search-after string[]">
    **Repeatable:** pass `--search-after` multiple times to supply more than one value
  </definition>
  <definition term="--slice string">
  </definition>
  <definition term="--fields string[]">
    Array of wildcard (*) patterns. The request returns values for field names
    matching these patterns in the hits.fields property of the response.
    **Repeatable:** pass `--fields` multiple times to supply more than one value
  </definition>
  <definition term="--suggest string">
  </definition>
  <definition term="--pit string">
    Limits the search to a point in time (PIT). If you provide a PIT, you
    cannot specify an <index> in the request path.
  </definition>
  <definition term="--runtime-mappings string">
    Defines one or more runtime fields in the search request. These fields take
    precedence over mapped fields with the same name.
  </definition>
  <definition term="--index string">
    A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices
    **Repeatable:** pass `--index` multiple times to supply more than one value
  </definition>
  <definition term="--error-trace">
    When set to `true` Elasticsearch will include the full stack trace of errors
    when they occur.
  </definition>
  <definition term="--filter-path string">
    Comma-separated list of filters in dot notation which reduce the response
    returned by Elasticsearch.
    **Repeatable:** pass `--filter-path` multiple times to supply more than one value
  </definition>
  <definition term="--human">
    When set to `true` will return statistics in a format suitable for humans.
    For example `"exists_time": "1h"` for humans and
    `"exists_time_in_millis": 3600000` for computers. When disabled the human
    readable values will be omitted. This makes sense for responses being consumed
    only by machines.
  </definition>
  <definition term="--pretty">
    If set to `true` the returned JSON will be "pretty-formatted". Only use
    this option for debugging only.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>