# Run a Fleet search
**POST /{index}/_fleet/_fleet_search**
**All methods and paths for this operation:**
GET
/{index}/_fleet/_fleet_search
POST
/{index}/_fleet/_fleet_search
The purpose of the Fleet search API is to provide an API where the search will be run only
after the provided checkpoint has been processed and is visible for searches inside of Elasticsearch.
## Required authorization
* Index privileges: `read`
## Servers
- http://api.example.com: http://api.example.com ()
## Authentication methods
- Api key auth
- Basic auth
- Bearer auth
## Parameters
### Path parameters
- **index** (string)
A single target to search. If the target is an index alias, it must resolve to a single index.
### Query parameters
- **allow_no_indices** (boolean)
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.
- **analyzer** (string)
- **analyze_wildcard** (boolean)
- **batched_reduce_size** (number)
- **ccs_minimize_roundtrips** (boolean)
- **default_operator** (string)
- **df** (string)
- **docvalue_fields** (string | array[string])
- **expand_wildcards** (string | array[string])
Supported values include:
- `all`: Match any data stream or index, including hidden ones.
- `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
- `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
- `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
- `none`: Wildcard expressions are not accepted.
- **explain** (boolean)
- **ignore_throttled** (boolean)
- **ignore_unavailable** (boolean)
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.
- **lenient** (boolean)
- **max_concurrent_shard_requests** (number)
- **preference** (string)
- **pre_filter_shard_size** (number)
- **request_cache** (boolean)
- **routing** (string | array[string])
Only to be used in query and path parameters, as the array form is actually a csv
- **scroll** (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.
- **search_type** (string)
Supported values include:
- `query_then_fetch`: Documents are scored using local term and document frequencies for the shard. This is usually faster but less accurate.
- `dfs_query_then_fetch`: Documents are scored using global term and document frequencies across all shards. This is usually slower but more accurate.
- **stats** (array[string])
- **stored_fields** (string | array[string])
- **suggest_field** (string)
Specifies which field to use for suggestions.
- **suggest_mode** (string)
Supported values include:
- `missing`: Only generate suggestions for terms that are not in the shard.
- `popular`: Only suggest terms that occur in more docs on the shard than the original term.
- `always`: Suggest any matching suggestions based on terms in the suggest text.
- **suggest_size** (number)
- **suggest_text** (string)
The source text for which the suggestions should be returned.
- **terminate_after** (number)
- **timeout** (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.
- **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.
- **track_scores** (boolean)
- **typed_keys** (boolean)
- **rest_total_hits_as_int** (boolean)
- **version** (boolean)
- **_source** (boolean | string | array[string])
Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.
Used as a query parameter along with the `_source_includes` and `_source_excludes` parameters.
- **_source_excludes** (string | array[string])
- **_source_includes** (string | array[string])
- **seq_no_primary_term** (boolean)
- **q** (string)
- **size** (number)
- **from** (number)
- **sort** (string | array[string])
- **wait_for_checkpoints** (array[number])
A comma separated list of checkpoints. When configured, the search API will only be executed on a shard
after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause
Elasticsearch to immediately execute the search.
- **allow_partial_search_results** (boolean)
If true, returns partial results if there are shard request timeouts or shard failures.
If false, returns an error with no partial results.
Defaults to the configured cluster setting `search.default_allow_partial_results`, which is true by default.
### Body: application/json (object)
- **aggregations** (object)
- **collapse** (object)
- **explain** (boolean)
If true, returns detailed information about score computation as part of a hit.
- **ext** (object)
Configuration of search extensions defined by Elasticsearch plugins.
- **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.
- **highlight** (object)
- **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.
- **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.
- **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)
- **profile** (boolean)
- **query** (object)
Defines the search definition using the Query DSL.
- **rescore** (object | array[object])
- **script_fields** (object)
Retrieve a script evaluation (based on different fields) for each hit.
- **search_after** (array[number | string | boolean | null])
- **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.
- **slice** (object)
- **sort** (string | object | array[string | object])
- **_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.
- **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.
- **suggest** (object)
- **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.
- **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.
- **version** (boolean)
If true, returns document version as part of a hit.
- **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.
- **runtime_mappings** (object)
Defines one or more runtime fields in the search request. These fields take
precedence over mapped fields with the same name.
- **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
#### Body: application/json (object)
- **took** (number)
- **timed_out** (boolean)
- **_shards** (object)
- **hits** (object)
- **aggregations** (object)
- **_clusters** (object)
- **fields** (object)
- **max_score** (number)
- **num_reduce_phases** (number)
- **profile** (object)
- **pit_id** (string)
- **_scroll_id** (string)
- **suggest** (object)
- **terminated_early** (boolean)
[Powered by Bump.sh](https://bump.sh)