{ "openapi": "3.0.3", "info": { "title": "Elasticsearch API", "license": { "name": "Apache 2.0", "url": "https://github.com/elastic/elasticsearch-specification/blob/main/LICENSE" }, "version": "", "description": "Elasticsearch provides REST APIs that are used by the UI components and can be called directly to configure and access Elasticsearch features.\n## Documentation source and versions\nThis documentation is derived from the `main` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).\nThis documentation contains work-in-progress information for future Elastic Stack releases.\n", "x-doc-license": { "name": "Attribution-NonCommercial-NoDerivatives 4.0 International", "url": "https://creativecommons.org/licenses/by-nc-nd/4.0/" }, "x-feedbackLink": { "label": "Feedback", "url": "https://github.com/elastic/docs-content/issues/new?assignees=&labels=feedback%2Ccommunity&projects=&template=api-feedback.yaml&title=%5BFeedback%5D%3A+" } }, "security": [ { "apiKeyAuth": [] }, { "basicAuth": [] }, { "bearerAuth": [] } ], "tags": [ { "name": "autoscaling", "x-displayName": "Autoscaling", "description": "The autoscaling APIs enable you to create and manage autoscaling policies and retrieve information about autoscaling capacity. Autoscaling adjusts resources based on demand. A deployment can use autoscaling to scale resources as needed, ensuring sufficient capacity to meet workload requirements.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/autoscaling", "description": "Learn more about autoscaling." } }, { "name": "analytics", "x-displayName": "Behavioral analytics", "description": "The behavioral analytics APIs let you create and manage analytics collections and view their data. Use them to analyze users’ search and click behavior, improve result relevance, and identify content gaps.\n" }, { "name": "cat", "x-displayName": "Compact and aligned text (CAT)", "description": "The compact and aligned text (CAT) APIs aim are intended only for human consumption using the Kibana console or command line. They are not intended for use by applications. For application consumption, it's recommend to use a corresponding JSON API.\nAll the cat commands accept a query string parameter `help` to see all the headers and info they provide, and the `/_cat` command alone lists all the available commands.\n" }, { "name": "cluster", "x-displayName": "Cluster", "description": "The cluster APIs enable you to retrieve information about your infrastructure on cluster, node, or shard level. You can manage cluster settings and voting configuration exceptions, collect node statistics and retrieve node information.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/distributed-architecture/discovery-cluster-formation/cluster-state-overview", "description": "Learn more about the cluster state." } }, { "name": "health_report", "x-displayName": "Cluster - Health", "description": "The cluster - health API provides you a report with the health status of an Elasticsearch cluster.\n" }, { "name": "connector", "x-displayName": "Connector", "description": "The connector and sync jobs APIs provide a convenient way to create and manage Elastic connectors and sync jobs in an internal index.\nConnectors are Elasticsearch integrations for syncing content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure.\nThis API provides an alternative to relying solely on Kibana UI for connector and sync job management. The API comes with a set of validations and assertions to ensure that the state representation in the internal index remains valid.\nThis API requires the `manage_connector` privilege or, for read-only endpoints, the `monitor_connector` privilege.\n", "externalDocs": { "url": "https://www.elastic.co/docs/reference/search-connectors/api-tutorial", "description": "Check out the connector API tutorial." } }, { "name": "ccr", "x-displayName": "Cross-cluster replication", "description": "The cross-cluster replication (CCR) APIs let you run replication operations, such as creating and managing follower indices or auto-follow patterns. Use CCR to replicate indices across clusters to maintain search availability during outages, reduce indexing impact, and lower search latency by serving requests closer to users.\n", "externalDocs": { "description": "Learn more about cross-cluster replication.", "url": "https://www.elastic.co/docs/deploy-manage/tools/cross-cluster-replication" } }, { "name": "data stream", "x-displayName": "Data stream", "description": "The data stream APIs enable you to create and manage data streams and data stream lifecycles. A data stream lets you store append-only time series data across multiple indices while giving you a single named resource for requests. Data streams are well-suited for logs, events, metrics, and other continuously generated data.\n", "externalDocs": { "description": "Learn more about data streams.", "url": "https://www.elastic.co/docs/manage-data/data-store/data-streams" } }, { "name": "document", "x-displayName": "Document", "description": "The document APIs enable you to create and manage documents in an Elasticsearch index.\n", "externalDocs": { "description": "Learn more about reading and writing documents.", "url": "https://www.elastic.co/docs/deploy-manage/distributed-architecture/reading-and-writing-documents" } }, { "name": "enrich", "x-displayName": "Enrich", "description": "The enrich APIs enable you to manage enrich policies. An enrich policy is a set of configuration options used to add the right enrich data to the right incoming documents.\n", "externalDocs": { "url": "https://www.elastic.co/docs/manage-data/ingest/transform-enrich/data-enrichment", "description": "Learn more about data enrichment." } }, { "name": "eql", "x-displayName": "EQL", "description": "Event Query Language (EQL) is a query language for event-based time series data, such as logs, metrics, and traces.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/query-filter/languages/eql", "description": "Learn more about EQL search." } }, { "name": "esql", "x-displayName": "ES|QL", "description": "The Elasticsearch Query Language (ES|QL) provides a powerful way to filter, transform, and analyze data stored in Elasticsearch, and in the future in other runtimes.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/query-filter/languages/esql", "description": "Learn more about ES|QL." } }, { "name": "features", "x-displayName": "Features", "description": "The feature APIs enable you to introspect and manage features provided by Elasticsearch and Elasticsearch plugins.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore#feature-state", "description": "Learn more about feature states." } }, { "name": "fleet", "x-displayName": "Fleet", "description": "The Fleet APIs support Fleet’s use of Elasticsearch as a data store for internal agent and action data.\n", "externalDocs": { "url": "https://www.elastic.co/docs/reference/fleet", "description": "Learn more about Fleet." } }, { "name": "graph", "x-displayName": "Graph explore", "description": "The graph explore API enables you to extract and summarize information about the documents and terms in an Elasticsearch data stream or index.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/visualize/graph", "description": "Get started with Graph." } }, { "name": "indices", "x-displayName": "Index", "description": "Index APIs enable you to manage individual indices, index settings, aliases, mappings, and index templates.\n", "externalDocs": { "url": "https://www.elastic.co/docs/manage-data/data-store/index-basics", "description": "Learn more about indices." } }, { "name": "ilm", "x-displayName": "Index lifecycle management", "description": "The index lifecycle management APIs enable you to set up policies to automatically manage the index lifecycle.\n", "externalDocs": { "url": "https://www.elastic.co/docs/manage-data/lifecycle/index-lifecycle-management", "description": "Learn more about managing the index lifecycle." } }, { "name": "inference", "x-displayName": "Inference", "description": "Inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api", "description": "Learn about default inference endpoints, adaptive allocations, and chunking." } }, { "name": "info", "x-displayName": "Info", "description": "The info API provides basic build, version, and cluster information.\n" }, { "name": "ingest", "x-displayName": "Ingest", "description": "Ingest APIs enable you to manage tasks and resources related to ingest pipelines and processors.", "externalDocs": { "url": "https://www.elastic.co/docs/manage-data/ingest", "description": "Learn more about ingesting data." } }, { "name": "license", "x-displayName": "Licensing", "description": "Licensing APIs enable you to manage your licenses.", "externalDocs": { "url": "https://www.elastic.co/subscriptions", "description": "For more information about the different types of licenses, refer to Elastic subscriptions." } }, { "name": "logstash", "x-displayName": "Logstash", "description": "Logstash APIs enable you to manage pipelines that are used by Logstash Central Management.\n", "externalDocs": { "url": "https://www.elastic.co/docs/reference/logstash/logstash-centralized-pipeline-management", "description": "Learn more about centralized pipeline management." } }, { "name": "ml", "x-displayName": "Machine learning", "description": "The machine learning APIs enable you to retrieve information related to the Elastic Stack machine learning features.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/machine-learning", "description": "Learn more about machine learning." } }, { "name": "ml anomaly", "x-displayName": "Machine learning anomaly detection", "description": "The machine learning anomaly detection APIs enable you to perform anomaly detection activities.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/machine-learning/anomaly-detection/ml-ad-finding-anomalies", "description": "Learn more about finding anomalies." } }, { "name": "ml data frame", "x-displayName": "Machine learning data frame analytics", "description": "The machine learning data frame analytics APIs enable you to perform data frame analytics activities.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/machine-learning/data-frame-analytics/ml-dfa-overview", "description": "Learn more about data frame analytics." } }, { "name": "ml trained model", "x-displayName": "Machine learning trained model", "description": "The machine learning trained models APIs enable you to perform model management operations.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/machine-learning/nlp/ml-nlp-overview", "description": "Learn more about natural language processing." } }, { "name": "migration", "x-displayName": "Migration", "description": "The migration APIs power Kibana's Upgrade Assistant feature.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/upgrade/prepare-to-upgrade/upgrade-assistant", "description": "Learn more about Kibana's Upgrade Assistant." } }, { "name": "monitoring", "x-displayName": "Monitoring", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/monitor", "description": "Learn more about monitoring." } }, { "name": "shutdown", "x-displayName": "Node lifecycle", "description": "The node lifecycle APIs enable you to prepare nodes for temporary or permanent shutdown, monitor the shutdown status, and enable a previously shut-down node to resume normal operations.\n" }, { "name": "project", "x-displayName": "Project", "description": "The project APIs enable you to get project tags and manage your project routing expressions.\n" }, { "name": "query_rules", "x-displayName": "Query rules", "description": "Query rules enable you to configure per-query rules that are applied at query time to queries that match the specific rule. Query rules are organized into rulesets, collections of query rules that are matched against incoming queries. Query rules are applied using the rule query.\nIf a query matches one or more rules in the ruleset, the query is re-written to apply the rules before searching. This allows pinning documents for only queries that match a specific term. Alternatively, you can use the [Query Rules UI](https://www.elastic.co/docs/solutions/search/query-rules-ui) to manage query rules.\n", "externalDocs": { "url": "https://www.elastic.co/docs/reference/elasticsearch/rest-apis/searching-with-query-rules", "description": "Learn more about searching with query rules." } }, { "name": "rollup", "x-displayName": "Rollup", "description": "The rollup APIs enable you to create, manage, and retrieve information about rollup jobs.\n", "externalDocs": { "url": "https://www.elastic.co/docs/manage-data/lifecycle/rollup", "description": "Learn more about rollup." } }, { "name": "script", "x-displayName": "Script", "description": "Use the script support APIs to get a list of supported script contexts and languages. Use the stored script APIs to manage stored scripts and search templates.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/scripting", "description": "Learn more about scripting." } }, { "name": "search", "x-displayName": "Search", "description": "The search APIs enable you to search and aggregate data stored in Elasticsearch indices and data streams.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze", "description": "Learn more about searching." } }, { "name": "search_application", "x-displayName": "Search application", "description": "The search application APIs enable you to manage tasks and resources related to Search Applications.\n", "externalDocs": { "url": "https://www.elastic.co/docs/solutions/search/search-applications", "description": "Learn more about search applications." } }, { "name": "searchable_snapshots", "x-displayName": "Searchable snapshots", "description": "The searchable snapshots APIs enable you to perform searchable snapshots operations.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/searchable-snapshots", "description": "Learn more about searchable snapshots." } }, { "name": "security", "x-displayName": "Security", "description": "The security APIs enable you to perform security activities, and add, update, retrieve, and remove application privileges, role mappings, and roles. You can also create and update API keys and create and invalidate bearer tokens.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/security", "description": "Learn more about security." } }, { "name": "snapshot", "x-displayName": "Snapshot and restore", "description": "Snapshot and restore APIs enable you to set up snapshot repositories, manage snapshot backups, and restore snapshots to a running cluster.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore", "description": "Learn more about snapshot and restore operations." } }, { "name": "slm", "x-displayName": "Snapshot lifecycle management", "description": "Snapshot lifecycle management (SLM) APIs enable you to set up policies to automatically take snapshots and control how long they are retained.\n", "externalDocs": { "url": "https://www.elastic.co/docs/deploy-manage/tools/snapshot-and-restore/create-snapshots", "description": "Learn more about creating a snapshot." } }, { "name": "sql", "x-displayName": "SQL", "description": "Elasticsearch's SQL APIs enable you to run SQL queries on Elasticsearch indices and data streams.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/query-filter/languages/sql", "description": "Check out the overview and tutorials for the Elasticsearch SQL features." } }, { "name": "streams", "x-displayName": "Streams" }, { "name": "synonyms", "x-displayName": "Synonyms", "description": "The synonyms management API provides a convenient way to define and manage synonyms in an internal system index. Related synonyms can be grouped in a \"synonyms set\". Create as many synonym sets as you need.\n", "externalDocs": { "url": "https://www.elastic.co/docs/solutions/search/full-text/search-with-synonyms", "description": "Learn more about synonyms." } }, { "name": "tasks", "x-displayName": "Task management", "description": "The task management APIs enable you to retrieve information about tasks or cancel tasks running in a cluster.\n", "externalDocs": { "url": "https://www.elastic.co/docs/troubleshoot/elasticsearch/task-queue-backlog", "description": "Check out the troubleshooting the Task Management API." } }, { "name": "text_structure", "x-displayName": "Text structure", "description": "The text structure APIs enable you to find the structure of a text field in an Elasticsearch index.\n" }, { "name": "transform", "x-displayName": "Transform", "description": "The transform APIs enable you to create and manage transforms.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/transforms", "description": "Learn more about transforms." } }, { "name": "xpack", "x-displayName": "Usage", "description": "The usage API provides usage information about the installed X-Pack features.\n" }, { "name": "watcher", "x-displayName": "Watcher", "description": "You can use Watcher to watch for changes or anomalies in your data and perform the necessary actions in response.\n", "externalDocs": { "url": "https://www.elastic.co/docs/explore-analyze/alerts-cases/watcher", "description": "Learn more about Watcher." } } ], "paths": { "/_async_search/{id}": { "get": { "tags": [ "search" ], "summary": "Get async search results", "description": "Retrieve the results of a previously submitted asynchronous search request.\nIf 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.\nWhen not specified, the `keep_alive` set with the corresponding submit async request will be used.\nOtherwise, it is possible to override the value and extend the validity of the request.\nWhen this period expires, the search, if still running, is cancelled.\nIf 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.\nFinal results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires.\nBy 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\nexpires or if no wait_for_completion_timeout is specified.\nIf true and the search is still running, the search response\nwill include any hits and partial aggregations that are available.\nIf false and the search is still running, the search response will not include any hits (but possibly include\ntotal hits) nor will include any partial aggregations.\nWhen 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-codeSamples": [ { "lang": "Console", "source": "GET /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" }, { "lang": "Python", "source": "resp = client.async_search.get(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" }, { "lang": "JavaScript", "source": "const response = await client.asyncSearch.get({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" }, { "lang": "Ruby", "source": "response = client.async_search.get(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" }, { "lang": "PHP", "source": "$resp = $client->asyncSearch()->get([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" }, { "lang": "curl", "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" }, { "lang": "Java", "source": "client.asyncSearch().get(g -> g\n .id(\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\")\n);\n" } ], "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.\nOtherwise, the saved search results are deleted.\nIf 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-codeSamples": [ { "lang": "Console", "source": "DELETE /_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" }, { "lang": "Python", "source": "resp = client.async_search.delete(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" }, { "lang": "JavaScript", "source": "const response = await client.asyncSearch.delete({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" }, { "lang": "Ruby", "source": "response = client.async_search.delete(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" }, { "lang": "PHP", "source": "$resp = $client->asyncSearch()->delete([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" }, { "lang": "curl", "source": "curl -X DELETE -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" }, { "lang": "Java", "source": "client.asyncSearch().delete(d -> d\n .id(\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\")\n);\n" } ], "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.\nIf the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to:\n\n* The user or API key that submitted the original async search request.\n* Users that have the `monitor` cluster privilege or greater privileges.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", "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.\nOngoing async searches and any saved search results are deleted after this period.", "deprecated": false, "schema": { "$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.\n", "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.\n", "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-codeSamples": [ { "lang": "Console", "source": "GET /_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\n" }, { "lang": "Python", "source": "resp = client.async_search.status(\n id=\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n)" }, { "lang": "JavaScript", "source": "const response = await client.asyncSearch.status({\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n});" }, { "lang": "Ruby", "source": "response = client.async_search.status(\n id: \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"\n)" }, { "lang": "PHP", "source": "$resp = $client->asyncSearch()->status([\n \"id\" => \"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\",\n]);" }, { "lang": "curl", "source": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_async_search/status/FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\"" }, { "lang": "Java", "source": "client.asyncSearch().status(s -> s\n .id(\"FmRldE8zREVEUzA2ZVpUeGs2ejJFUFEaMkZ5QTVrSTZSaVN3WlNFVmtlWHJsdzoxMDc=\")\n);\n" } ], "x-metaTags": [ { "content": "Elasticsearch", "name": "product_name" } ] } }, "/{index}/_async_search": { "post": { "tags": [ "search" ], "summary": "Run an async search\n", "description": "**All methods and paths for this operation:**\n\n