Elastic Stack (ELK Stack) Search API
The search API from Elastic Stack (ELK Stack) — 29 operation(s) for search.
The search API from Elastic Stack (ELK Stack) — 29 operation(s) for search.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/elk-stack-search-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Elasticsearch Request & Response Specification Search API
license:
name: Apache 2.0
url: https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE
version: ''
tags:
- name: search
paths:
/_async_search/{id}:
get:
tags:
- search
summary: Get async search results
description: 'Retrieve the results of a previously submitted asynchronous search request.
If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it.'
operationId: async-search-get
parameters:
- in: path
name: id
description: A unique identifier for the async search.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Id'
style: simple
- in: query
name: keep_alive
description: 'The length of time that the async search should be available in the cluster.
When not specified, the `keep_alive` set with the corresponding submit async request will be used.
Otherwise, it is possible to override the value and extend the validity of the request.
When this period expires, the search, if still running, is cancelled.
If the search is completed, its saved results are deleted.'
deprecated: false
schema:
$ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: typed_keys
description: Specify whether aggregation and suggester names should be prefixed by their respective types in the response
deprecated: false
schema:
type: boolean
style: form
- in: query
name: wait_for_completion_timeout
description: 'Specifies to wait for the search to be completed up until the provided timeout.
Final results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.
By default no timeout is set meaning that the currently available results will be returned without any additional wait.'
deprecated: false
schema:
$ref: '#/components/schemas/_types.Duration'
style: form
- in: query
name: return_intermediate_results
description: 'Specifies whether the response should contain intermediate results if the query is still running when the wait_for_completion_timeout
expires or if no wait_for_completion_timeout is specified.
If true and the search is still running, the search response
will include any hits and partial aggregations that are available.
If false and the search is still running, the search response will not include any hits (but possibly include
total hits) nor will include any partial aggregations.
When not specified, the intermediate results are returned for running queries.'
deprecated: false
schema:
type: boolean
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/async_search._types.AsyncSearchDocumentResponseBase'
examples:
AsyncSearchGetResponseExample1:
description: A succesful response from `GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=`.
value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_partial\" : false, \n \"is_running\" : false, \n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986, \n \"completion_time_in_millis\" : 1583945903130, \n \"response\" : {\n \"took\" : 12144,\n \"timed_out\" : false,\n \"num_reduce_phases\" : 46, \n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188, \n \"skipped\" : 0,\n \"failed\" : 0\n },\n \"hits\" : {\n \"total\" : {\n \"value\" : 456433,\n \"relation\" : \"eq\"\n },\n \"max_score\" : null,\n \"hits\" : [ ]\n },\n \"aggregations\" : { \n \"sale_date\" : {\n \"buckets\" : []\n }\n }\n }\n}"
x-state: Generally available; Added in 7.7.0
x-metaTags:
- content: Elasticsearch
name: product_name
delete:
tags:
- search
summary: Delete an async search
description: 'If the asynchronous search is still running, it is cancelled.
Otherwise, the saved search results are deleted.
If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the `cancel_task` cluster privilege.'
operationId: async-search-delete
parameters:
- in: path
name: id
description: A unique identifier for the async search.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Id'
style: simple
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/_types.AcknowledgedResponseBase'
x-state: Generally available; Added in 7.7.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_async_search/status/{id}:
get:
tags:
- search
summary: Get the async search status
description: 'Get the status of a previously submitted async search request given its identifier, without retrieving search results.
If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:
* The user or API key that submitted the original async search request.
* Users that have the `monitor` cluster privilege or greater privileges.
## Required authorization
* Cluster privileges: `monitor`
'
operationId: async-search-status
parameters:
- in: path
name: id
description: A unique identifier for the async search.
required: true
deprecated: false
schema:
$ref: '#/components/schemas/_types.Id'
style: simple
- in: query
name: keep_alive
description: 'The length of time that the async search needs to be available.
Ongoing async searches and any saved search results are deleted after this period.'
deprecated: false
schema:
default: 5d
allOf:
- $ref: '#/components/schemas/_types.Duration'
style: form
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/async_search.status.StatusResponseBase'
examples:
AsyncSearchStatusResponseExample1:
summary: An active async search
description: A succesful response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=`, which retrieves the status of a previously submitted async search without the results.
value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : true,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 188, \n \"skipped\" : 0,\n \"failed\" : 0\n }\n}"
AsyncSearchStatusResponseExample2:
summary: A completed async search
description: 'A succesful response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=` for an async search that has completed. The status response has an additional `completion_status` field that shows the status code of the completed async search.
'
value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : false,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 562,\n \"skipped\" : 0,\n \"failed\" : 0\n },\n\"completion_status\" : 200 \n}"
AsyncSearchStatusResponseExample3:
summary: A failed async search
description: 'A response from `GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=` for an async search that has completed with an error. The status response has an additional `completion_status` field that shows the status code of the completed async search.
'
value: "{\n \"id\" : \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n \"is_running\" : false,\n \"is_partial\" : true,\n \"start_time_in_millis\" : 1583945890986,\n \"expiration_time_in_millis\" : 1584377890986,\n \"_shards\" : {\n \"total\" : 562,\n \"successful\" : 450,\n \"skipped\" : 0,\n \"failed\" : 112\n },\n\"completion_status\" : 503 \n}"
x-state: Generally available; Added in 7.11.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_async_search:
post:
tags:
- search
summary: Run an async search
description: '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.'
operationId: async-search-submit
parameters:
- $ref: '#/components/parameters/async_search.submit-wait_for_completion_timeout'
- $ref: '#/components/parameters/async_search.submit-keep_alive'
- $ref: '#/components/parameters/async_search.submit-keep_on_completion'
- $ref: '#/components/parameters/async_search.submit-allow_no_indices'
- $ref: '#/components/parameters/async_search.submit-allow_partial_search_results'
- $ref: '#/components/parameters/async_search.submit-analyzer'
- $ref: '#/components/parameters/async_search.submit-analyze_wildcard'
- $ref: '#/components/parameters/async_search.submit-batched_reduce_size'
- $ref: '#/components/parameters/async_search.submit-ccs_minimize_roundtrips'
- $ref: '#/components/parameters/async_search.submit-default_operator'
- $ref: '#/components/parameters/async_search.submit-df'
- $ref: '#/components/parameters/async_search.submit-docvalue_fields'
- $ref: '#/components/parameters/async_search.submit-expand_wildcards'
- $ref: '#/components/parameters/async_search.submit-explain'
- $ref: '#/components/parameters/async_search.submit-ignore_throttled'
- $ref: '#/components/parameters/async_search.submit-ignore_unavailable'
- $ref: '#/components/parameters/async_search.submit-lenient'
- $ref: '#/components/parameters/async_search.submit-max_concurrent_shard_requests'
- $ref: '#/components/parameters/async_search.submit-preference'
- $ref: '#/components/parameters/async_search.submit-request_cache'
- $ref: '#/components/parameters/async_search.submit-routing'
- $ref: '#/components/parameters/async_search.submit-search_type'
- $ref: '#/components/parameters/async_search.submit-stats'
- $ref: '#/components/parameters/async_search.submit-stored_fields'
- $ref: '#/components/parameters/async_search.submit-suggest_field'
- $ref: '#/components/parameters/async_search.submit-suggest_mode'
- $ref: '#/components/parameters/async_search.submit-suggest_size'
- $ref: '#/components/parameters/async_search.submit-suggest_text'
- $ref: '#/components/parameters/async_search.submit-terminate_after'
- $ref: '#/components/parameters/async_search.submit-timeout'
- $ref: '#/components/parameters/async_search.submit-track_total_hits'
- $ref: '#/components/parameters/async_search.submit-track_scores'
- $ref: '#/components/parameters/async_search.submit-typed_keys'
- $ref: '#/components/parameters/async_search.submit-rest_total_hits_as_int'
- $ref: '#/components/parameters/async_search.submit-version'
- $ref: '#/components/parameters/async_search.submit-_source'
- $ref: '#/components/parameters/async_search.submit-_source_excludes'
- $ref: '#/components/parameters/async_search.submit-_source_includes'
- $ref: '#/components/parameters/async_search.submit-seq_no_primary_term'
- $ref: '#/components/parameters/async_search.submit-q'
- $ref: '#/components/parameters/async_search.submit-size'
- $ref: '#/components/parameters/async_search.submit-from'
- $ref: '#/components/parameters/async_search.submit-sort'
requestBody:
$ref: '#/components/requestBodies/async_search.submit'
responses:
'200':
$ref: '#/components/responses/async_search.submit-200'
x-state: Generally available; Added in 7.7.0
x-metaTags:
- content: Elasticsearch
name: product_name
/{index}/_async_search:
post:
tags:
- search
summary: Run an async search
description: '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.'
operationId: async-search-submit-1
parameters:
- $ref: '#/components/parameters/async_search.submit-index'
- $ref: '#/components/parameters/async_search.submit-wait_for_completion_timeout'
- $ref: '#/components/parameters/async_search.submit-keep_alive'
- $ref: '#/components/parameters/async_search.submit-keep_on_completion'
- $ref: '#/components/parameters/async_search.submit-allow_no_indices'
- $ref: '#/components/parameters/async_search.submit-allow_partial_search_results'
- $ref: '#/components/parameters/async_search.submit-analyzer'
- $ref: '#/components/parameters/async_search.submit-analyze_wildcard'
- $ref: '#/components/parameters/async_search.submit-batched_reduce_size'
- $ref: '#/components/parameters/async_search.submit-ccs_minimize_roundtrips'
- $ref: '#/components/parameters/async_search.submit-default_operator'
- $ref: '#/components/parameters/async_search.submit-df'
- $ref: '#/components/parameters/async_search.submit-docvalue_fields'
- $ref: '#/components/parameters/async_search.submit-expand_wildcards'
- $ref: '#/components/parameters/async_search.submit-explain'
- $ref: '#/components/parameters/async_search.submit-ignore_throttled'
- $ref: '#/components/parameters/async_search.submit-ignore_unavailable'
- $ref: '#/components/parameters/async_search.submit-lenient'
- $ref: '#/components/parameters/async_search.submit-max_concurrent_shard_requests'
- $ref: '#/components/parameters/async_search.submit-preference'
- $ref: '#/components/parameters/async_search.submit-request_cache'
- $ref: '#/components/parameters/async_search.submit-routing'
- $ref: '#/components/parameters/async_search.submit-search_type'
- $ref: '#/components/parameters/async_search.submit-stats'
- $ref: '#/components/parameters/async_search.submit-stored_fields'
- $ref: '#/components/parameters/async_search.submit-suggest_field'
- $ref: '#/components/parameters/async_search.submit-suggest_mode'
- $ref: '#/components/parameters/async_search.submit-suggest_size'
- $ref: '#/components/parameters/async_search.submit-suggest_text'
- $ref: '#/components/parameters/async_search.submit-terminate_after'
- $ref: '#/components/parameters/async_search.submit-timeout'
- $ref: '#/components/parameters/async_search.submit-track_total_hits'
- $ref: '#/components/parameters/async_search.submit-track_scores'
- $ref: '#/components/parameters/async_search.submit-typed_keys'
- $ref: '#/components/parameters/async_search.submit-rest_total_hits_as_int'
- $ref: '#/components/parameters/async_search.submit-version'
- $ref: '#/components/parameters/async_search.submit-_source'
- $ref: '#/components/parameters/async_search.submit-_source_excludes'
- $ref: '#/components/parameters/async_search.submit-_source_includes'
- $ref: '#/components/parameters/async_search.submit-seq_no_primary_term'
- $ref: '#/components/parameters/async_search.submit-q'
- $ref: '#/components/parameters/async_search.submit-size'
- $ref: '#/components/parameters/async_search.submit-from'
- $ref: '#/components/parameters/async_search.submit-sort'
requestBody:
$ref: '#/components/requestBodies/async_search.submit'
responses:
'200':
$ref: '#/components/responses/async_search.submit-200'
x-state: Generally available; Added in 7.7.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_search/scroll:
get:
tags:
- search
summary: Run a scrolling search
description: 'IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT).
The scroll API gets large sets of results from a single scrolling search request.
To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter.
The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request.
The search response returns a scroll ID in the `_scroll_id` response body parameter.
You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request.
If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search.
You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.
IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
## Required authorization
* Index privileges: `read`
'
externalDocs:
description: About paginating search results
url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/scroll-api.html
operationId: scroll
parameters:
- $ref: '#/components/parameters/scroll-scroll'
- $ref: '#/components/parameters/scroll-scroll_id_'
- $ref: '#/components/parameters/scroll-rest_total_hits_as_int'
requestBody:
$ref: '#/components/requestBodies/scroll'
responses:
'200':
$ref: '#/components/responses/scroll-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
post:
tags:
- search
summary: Run a scrolling search
description: 'IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT).
The scroll API gets large sets of results from a single scrolling search request.
To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter.
The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request.
The search response returns a scroll ID in the `_scroll_id` response body parameter.
You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request.
If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search.
You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.
IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
## Required authorization
* Index privileges: `read`
'
externalDocs:
description: About paginating search results
url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/scroll-api.html
operationId: scroll-1
parameters:
- $ref: '#/components/parameters/scroll-scroll'
- $ref: '#/components/parameters/scroll-scroll_id_'
- $ref: '#/components/parameters/scroll-rest_total_hits_as_int'
requestBody:
$ref: '#/components/requestBodies/scroll'
responses:
'200':
$ref: '#/components/responses/scroll-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
delete:
tags:
- search
summary: Clear a scrolling search
description: Clear the search context and results for a scrolling search.
externalDocs:
description: About paginating search results
url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/clear-scroll-api.html
operationId: clear-scroll
requestBody:
$ref: '#/components/requestBodies/clear_scroll'
responses:
'200':
$ref: '#/components/responses/clear_scroll-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
/_search/scroll/{scroll_id}:
get:
tags:
- search
summary: Run a scrolling search
description: 'IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT).
The scroll API gets large sets of results from a single scrolling search request.
To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter.
The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request.
The search response returns a scroll ID in the `_scroll_id` response body parameter.
You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request.
If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search.
You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.
IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
## Required authorization
* Index privileges: `read`
'
externalDocs:
description: About paginating search results
url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/scroll-api.html
operationId: scroll-2
parameters:
- $ref: '#/components/parameters/scroll-scroll_id'
- $ref: '#/components/parameters/scroll-scroll'
- $ref: '#/components/parameters/scroll-scroll_id_'
- $ref: '#/components/parameters/scroll-rest_total_hits_as_int'
requestBody:
$ref: '#/components/requestBodies/scroll'
responses:
'200':
$ref: '#/components/responses/scroll-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
post:
tags:
- search
summary: Run a scrolling search
description: 'IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the `search_after` parameter with a point in time (PIT).
The scroll API gets large sets of results from a single scrolling search request.
To get the necessary scroll ID, submit a search API request that includes an argument for the `scroll` query parameter.
The `scroll` parameter indicates how long Elasticsearch should retain the search context for the request.
The search response returns a scroll ID in the `_scroll_id` response body parameter.
You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request.
If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search.
You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context.
IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests.
## Required authorization
* Index privileges: `read`
'
externalDocs:
description: About paginating search results
url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/scroll-api.html
operationId: scroll-3
parameters:
- $ref: '#/components/parameters/scroll-scroll_id'
- $ref: '#/components/parameters/scroll-scroll'
- $ref: '#/components/parameters/scroll-scroll_id_'
- $ref: '#/components/parameters/scroll-rest_total_hits_as_int'
requestBody:
$ref: '#/components/requestBodies/scroll'
responses:
'200':
$ref: '#/components/responses/scroll-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
delete:
tags:
- search
summary: Clear a scrolling search
description: Clear the search context and results for a scrolling search.
externalDocs:
description: About paginating search results
url: https://www.elastic.co/docs/reference/elasticsearch/rest-apis/paginate-search-results#scroll-search-results
x-previousVersionUrl: https://www.elastic.co/guide/en/elasticsearch/reference/8.19/clear-scroll-api.html
operationId: clear-scroll-1
parameters:
- $ref: '#/components/parameters/clear_scroll-scroll_id'
requestBody:
$ref: '#/components/requestBodies/clear_scroll'
responses:
'200':
$ref: '#/components/responses/clear_scroll-200'
x-state: Generally available
x-metaTags:
- content: Elasticsearch
name: product_name
/_pit:
delete:
tags:
- search
summary: Close a point in time
description: 'A point in time must be opened explicitly before being used in search requests.
The `keep_alive` parameter tells Elasticsearch how long it should persist.
A point in time is automatically closed when the `keep_alive` period has elapsed.
However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.'
operationId: close-point-in-time
requestBody:
content:
application/json:
schema:
type: object
properties:
id:
description: The ID of the point-in-time.
allOf:
- $ref: '#/components/schemas/_types.Id'
required:
- id
examples:
ClosePointInTimeRequestExample1:
description: Run `DELETE /_pit` to close a point-in-time.
value: "{\n \"id\": \"46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==\"\n}"
required: true
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
succeeded:
description: If `true`, all search contexts associated with the point-in-time ID were successfully closed.
type: boolean
num_freed:
description: The number of search contexts that were successfully closed.
type: number
required:
- succeeded
- num_freed
examples:
ClosePointInTimeResponseExample1:
description: A successful response from `DELETE /_pit`.
value: "{\n \"succeeded\": true, \n \"num_freed\": 3 \n}"
x-state: Generally available; Added in 7.10.0
x-metaTags:
- content: Elasticsearch
name: product_name
/_count:
get:
tags:
- search
summary: Count search results
description: 'Get the number of documents matching a query.
The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body.
The query is optional. When no query is provided, the API uses `match_all` to count all the documents.
The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices.
The operation is broadcast across all shards.
For each shard ID group, a replica is chosen and the search is run against it.
This means that replicas increase the scalability of the count.
## Required authorization
* Index privileges: `read`
'
operationId: count-1
parameters:
- $ref: '#/components/parameters/count-allow_no_indices'
- $ref: '#/components/parameters/count-analyzer'
- $ref: '#/components/parameters/count-analyze_wildcard'
- $ref: '#/components/parameters/count-default_operator'
- $ref: '#/components/parameters/count-df'
- $ref: '#/components/parameters/count-expand_wildc
# --- truncated at 32 KB (707 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/elk-stack/refs/heads/main/openapi/elk-stack-search-api-openapi.yml