Elasticsearch API logo
Elastic APIs hub
  • Elastic Cloud API
  • Elastic Cloud Billing API
  • Elastic Cloud Enterprise API
  • Elastic Cloud Serverless API
  • Elasticsearch API
  • Elasticsearch Serverless API
  • Kibana API
  • Kibana Serverless API
  • Logstash API
  • Observability Intake Serverless API
Back to hub page
API Changelog
Download source
  • JSON OpenAPI specification
  • YAML OpenAPI specification
Feedback
v8
  • main default
  • v8
  • v9

Topics

  • Introduction
  • Authentication

Endpoints

  • Autoscaling
    • Get an autoscaling policy GET
    • Create or update an autoscaling policy PUT
    • Delete an autoscaling policy DELETE
    • Get the autoscaling capacity GET
  • Behavioral analytics
    • Get behavioral analytics collections GET
    • Create a behavioral analytics collection PUT
    • Delete a behavioral analytics collection DELETE
    • Get behavioral analytics collections GET
    • Create a behavioral analytics collection event POST
  • Compact and aligned text (CAT)
    • Get aliases GET
    • Get aliases GET
    • Get shard allocation information GET
    • Get shard allocation information GET
    • Get component templates GET
    • Get component templates GET
    • Get a document count GET
    • Get a document count GET
    • Get field data cache information GET
    • Get field data cache information GET
    • Get the cluster health status GET
    • Get CAT help GET
    • Get index information GET
    • Get index information GET
    • Get master node information GET
    • Get data frame analytics jobs GET
    • Get data frame analytics jobs GET
    • Get datafeeds GET
    • Get datafeeds GET
    • Get anomaly detection jobs GET
    • Get anomaly detection jobs GET
    • Get trained models GET
    • Get trained models GET
    • Get node attribute information GET
    • Get node information GET
    • Get pending task information GET
    • Get plugin information GET
    • Get shard recovery information GET
    • Get shard recovery information GET
    • Get snapshot repository information GET
    • Get segment information GET
    • Get segment information GET
    • Get shard information GET
    • Get shard information GET
    • Get snapshot information GET
    • Get snapshot information GET
    • Get task information GET
    • Get index template information GET
    • Get index template information GET
    • Get thread pool statistics GET
    • Get thread pool statistics GET
    • Get transform information GET
    • Get transform information GET
  • Cluster
    • Explain the shard allocations GET
    • Explain the shard allocations POST
    • Update voting configuration exclusions POST
    • Clear cluster voting config exclusions DELETE
    • Get cluster-wide settings GET
    • Update the cluster settings PUT
    • Get the cluster health status GET
    • Get the cluster health status GET
    • Get cluster info GET
    • Get the pending cluster tasks GET
    • Get remote cluster information GET
    • Reroute the cluster POST
    • Get the cluster state GET
    • Get the cluster state GET
    • Get the cluster state GET
    • Get cluster statistics GET
    • Get cluster statistics GET
    • Ping the cluster HEAD
    • Clear the archived repositories metering DELETE
    • Get cluster repositories metering GET
    • Get the hot threads for nodes GET
    • Get the hot threads for nodes GET
    • Get node information GET
    • Get node information GET
    • Get node information GET
    • Get node information GET
    • Reload the keystore on nodes in the cluster POST
    • Reload the keystore on nodes in the cluster POST
    • Get node statistics GET
    • Get node statistics GET
    • Get node statistics GET
    • Get node statistics GET
    • Get node statistics GET
    • Get node statistics GET
    • Get feature usage information GET
    • Get feature usage information GET
    • Get feature usage information GET
    • Get feature usage information GET
  • Cluster - Health
    • Get the cluster health GET
    • Get the cluster health GET
  • Connector
    • Check in a connector PUT
    • Get a connector GET
    • Create or update a connector PUT
    • Delete a connector DELETE
    • Get all connectors GET
    • Create or update a connector PUT
    • Create a connector POST
    • Cancel a connector sync job PUT
    • Check in a connector sync job PUT
    • Claim a connector sync job PUT
    • Get a connector sync job GET
    • Delete a connector sync job DELETE
    • Set a connector sync job error PUT
    • Get all connector sync jobs GET
    • Create a connector sync job POST
    • Set the connector sync job stats PUT
    • Activate the connector draft filter PUT
    • Update the connector API key ID PUT
    • Update the connector configuration PUT
    • Update the connector error field PUT
    • Update the connector features PUT
    • Update the connector filtering PUT
    • Update the connector draft filtering validation PUT
    • Update the connector index name PUT
    • Update the connector name and description PUT
    • Update the connector is_native flag PUT
    • Update the connector pipeline PUT
    • Update the connector scheduling PUT
    • Update the connector service type PUT
    • Update the connector status PUT
  • Cross-cluster replication
    • Get auto-follow patterns GET
    • Create or update auto-follow patterns PUT
    • Delete auto-follow patterns DELETE
    • Create a follower PUT
    • Get follower information GET
    • Get follower stats GET
    • Forget a follower POST
    • Get auto-follow patterns GET
    • Pause an auto-follow pattern POST
    • Pause a follower POST
    • Resume an auto-follow pattern POST
    • Resume a follower POST
    • Get cross-cluster replication stats GET
    • Unfollow an index POST
  • Data stream
    • Get data streams GET
    • Create a data stream PUT
    • Delete data streams DELETE
    • Get data stream stats GET
    • Get data stream stats GET
    • Get data stream lifecycles GET
    • Update data stream lifecycles PUT
    • Downsample an index POST
    • Get the status for a data stream lifecycle GET
    • Get data stream lifecycle stats GET
    • Get data streams GET
    • Convert an index alias to a data stream POST
    • Update data streams POST
    • Promote a data stream POST
  • Document
    • Bulk index or delete documents PUT
    • Bulk index or delete documents POST
    • Bulk index or delete documents PUT
    • Bulk index or delete documents POST
    • Create a new document in the index PUT
    • Create a new document in the index POST
    • Get a document by its ID GET
    • Create or update a document in an index PUT
    • Create or update a document in an index POST
    • Delete a document DELETE
    • Check a document HEAD
    • Delete documents POST
    • Throttle a delete by query operation POST
    • Get a document's source GET
    • Check for a document source HEAD
    • Create or update a document in an index POST
    • Get multiple documents GET
    • Get multiple documents POST
    • Get multiple documents GET
    • Get multiple documents POST
    • Get multiple term vectors GET
    • Get multiple term vectors POST
    • Get multiple term vectors GET
    • Get multiple term vectors POST
    • Reindex documents POST
    • Throttle a reindex operation POST
    • Get term vector information GET
    • Get term vector information POST
    • Get term vector information GET
    • Get term vector information POST
    • Update a document POST
    • Update documents POST
    • Throttle an update by query operation POST
  • Enrich
    • Get an enrich policy GET
    • Create an enrich policy PUT
    • Delete an enrich policy DELETE
    • Run an enrich policy PUT
    • Get an enrich policy GET
    • Get enrich stats GET
  • EQL
    • Get async EQL search results GET
    • Delete an async EQL search DELETE
    • Get the async EQL status GET
    • Get EQL search results GET
    • Get EQL search results POST
  • ES|QL
    • Run an async ES|QL query POST
    • Get async ES|QL query results GET
    • Delete an async ES|QL query DELETE
    • Stop async ES|QL query POST
    • Run an ES|QL query POST
  • Features
    • Get the features GET
    • Reset the features POST
  • Fleet
    • Get global checkpoints GET
    • Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request GET
    • Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request POST
    • Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request GET
    • Executes several [fleet searches](https://www.elastic.co/guide/en/elasticsearch/reference/current/fleet-search.html) with a single API request POST
    • The purpose of the fleet search api is to provide a search api where the search will only be executed GET
    • The purpose of the fleet search api is to provide a search api where the search will only be executed POST
  • Graph explore
    • Explore graph analytics GET
    • Explore graph analytics POST
  • Index
    • Get component templates GET
    • Create or update a component template PUT
    • Create or update a component template POST
    • Delete component templates DELETE
    • Check component templates HEAD
    • Get component templates GET
    • Import a dangling index POST
    • Delete a dangling index DELETE
    • Get the dangling indices GET
    • Add an index block PUT
    • Get tokens from text analysis GET
    • Get tokens from text analysis POST
    • Get tokens from text analysis GET
    • Get tokens from text analysis POST
    • Clear the cache POST
    • Clear the cache POST
    • Clone an index PUT
    • Clone an index POST
    • Close an index POST
    • Get index information GET
    • Create an index PUT
    • Delete indices DELETE
    • Check indices HEAD
    • Get aliases GET
    • Create or update an alias PUT
    • Create or update an alias POST
    • Delete an alias DELETE
    • Check aliases HEAD
    • Create or update an alias PUT
    • Create or update an alias POST
    • Delete an alias DELETE
    • Delete data stream lifecycles DELETE
    • Get index templates GET
    • Create or update an index template PUT
    • Create or update an index template POST
    • Delete an index template DELETE
    • Check index templates HEAD
    • Get index templates GET
    • Create or update an index template PUT
    • Create or update an index template POST
    • Delete a legacy index template DELETE
    • Check existence of index templates HEAD
    • Analyze the index disk usage POST
    • Get aliases GET
    • Check aliases HEAD
    • Get field usage stats GET
    • Flush data streams or indices GET
    • Flush data streams or indices POST
    • Flush data streams or indices GET
    • Flush data streams or indices POST
    • Force a merge POST
    • Force a merge POST
    • Get aliases GET
    • Get aliases GET
    • Get mapping definitions GET
    • Get mapping definitions GET
    • Get index templates GET
    • Get mapping definitions GET
    • Get mapping definitions GET
    • Update field mappings PUT
    • Update field mappings POST
    • Get index settings GET
    • Update index settings PUT
    • Get index settings GET
    • Update index settings PUT
    • Get index settings GET
    • Get index settings GET
    • Get index templates GET
    • Open a closed index POST
    • Get index recovery information GET
    • Get index recovery information GET
    • Refresh an index GET
    • Refresh an index POST
    • Refresh an index GET
    • Refresh an index POST
    • Reload search analyzers GET
    • Reload search analyzers POST
    • Resolve the cluster GET
    • Resolve the cluster GET
    • Resolve indices GET
    • Roll over to a new index POST
    • Roll over to a new index POST
    • Get index segments GET
    • Get index segments GET
    • Get index shard stores GET
    • Get index shard stores GET
    • Shrink an index PUT
    • Shrink an index POST
    • Simulate an index POST
    • Simulate an index template POST
    • Simulate an index template POST
    • Split an index PUT
    • Split an index POST
    • Get index statistics GET
    • Get index statistics GET
    • Get index statistics GET
    • Get index statistics GET
    • Unfreeze an index POST
    • Create or update an alias POST
    • Validate a query GET
    • Validate a query POST
    • Validate a query GET
    • Validate a query POST
  • Index lifecycle management
    • Get lifecycle policies GET
    • Create or update a lifecycle policy PUT
    • Delete a lifecycle policy DELETE
    • Explain the lifecycle state GET
    • Get lifecycle policies GET
    • Get the ILM status GET
    • Migrate to data tiers routing POST
    • Move to a lifecycle step POST
    • Remove policies from an index POST
    • Retry a policy POST
    • Start the ILM plugin POST
    • Stop the ILM plugin POST
  • Inference
    • Perform chat completion inference POST
    • Perform completion inference on the service POST
    • Get an inference endpoint GET
    • Create an inference endpoint PUT
    • Perform inference on the service POST
    • Delete an inference endpoint DELETE
    • Get an inference endpoint GET
    • Create an inference endpoint PUT
    • Perform inference on the service POST
    • Delete an inference endpoint DELETE
    • Get an inference endpoint GET
    • Create an AlibabaCloud AI Search inference endpoint PUT
    • Create an Amazon Bedrock inference endpoint PUT
    • Create an Anthropic inference endpoint PUT
    • Create an Azure AI studio inference endpoint PUT
    • Create an Azure OpenAI inference endpoint PUT
    • Create a Cohere inference endpoint PUT
    • Create an Elasticsearch inference endpoint PUT
    • Create an ELSER inference endpoint PUT
    • Create an Google AI Studio inference endpoint PUT
    • Create a Google Vertex AI inference endpoint PUT
    • Create a Hugging Face inference endpoint PUT
    • Create an JinaAI inference endpoint PUT
    • Create a Mistral inference endpoint PUT
    • Create an OpenAI inference endpoint PUT
    • Create a VoyageAI inference endpoint PUT
    • Create a Watsonx inference endpoint PUT
    • Perform rereanking inference on the service POST
    • Perform sparse embedding inference on the service POST
    • Perform streaming inference POST
    • Perform text embedding inference on the service POST
    • Update an inference endpoint PUT
    • Update an inference endpoint PUT
  • Info
    • Get cluster info GET
  • Ingest
    • Get GeoIP database configurations GET
    • Create or update a GeoIP database configuration PUT
    • Delete GeoIP database configurations DELETE
    • Get IP geolocation database configurations GET
    • Create or update an IP geolocation database configuration PUT
    • Delete IP geolocation database configurations DELETE
    • Get pipelines GET
    • Create or update a pipeline PUT
    • Delete pipelines DELETE
    • Get GeoIP statistics GET
    • Get GeoIP database configurations GET
    • Get IP geolocation database configurations GET
    • Get pipelines GET
    • Run a grok processor GET
    • Simulate a pipeline GET
    • Simulate a pipeline POST
    • Simulate a pipeline GET
    • Simulate a pipeline POST
    • Simulate data ingestion GET
    • Simulate data ingestion POST
    • Simulate data ingestion GET
    • Simulate data ingestion POST
  • Licensing
    • Get license information GET
    • Update the license PUT
    • Update the license POST
    • Delete the license DELETE
    • Get the basic license status GET
    • Get the trial status GET
    • Start a basic license POST
    • Start a trial POST
  • Logstash
    • Get Logstash pipelines GET
    • Create or update a Logstash pipeline PUT
    • Delete a Logstash pipeline DELETE
    • Get Logstash pipelines GET
  • Machine learning
    • Get machine learning memory usage info GET
    • Get machine learning memory usage info GET
    • Get machine learning information GET
    • Set upgrade_mode for ML indices POST
  • Machine learning anomaly detection
    • Close anomaly detection jobs POST
    • Get calendar configuration info GET
    • Create a calendar PUT
    • Get calendar configuration info POST
    • Delete a calendar DELETE
    • Delete events from a calendar DELETE
    • Add anomaly detection job to calendar PUT
    • Delete anomaly jobs from a calendar DELETE
    • Get datafeeds configuration info GET
    • Create a datafeed PUT
    • Delete a datafeed DELETE
    • Delete expired ML data DELETE
    • Delete expired ML data DELETE
    • Get filters GET
    • Create a filter PUT
    • Delete a filter DELETE
    • Predict future behavior of a time series POST
    • Delete forecasts from a job DELETE
    • Delete forecasts from a job DELETE
    • Get anomaly detection jobs configuration info GET
    • Create an anomaly detection job PUT
    • Delete an anomaly detection job DELETE
    • Get model snapshots info GET
    • Get model snapshots info POST
    • Delete a model snapshot DELETE
    • Estimate job model memory usage POST
    • Force buffered data to be processed POST
    • Get anomaly detection job results for buckets GET
    • Get anomaly detection job results for buckets POST
    • Get anomaly detection job results for buckets GET
    • Get anomaly detection job results for buckets POST
    • Get info about events in calendars GET
    • Add scheduled events to the calendar POST
    • Get calendar configuration info GET
    • Get calendar configuration info POST
    • Get anomaly detection job results for categories GET
    • Get anomaly detection job results for categories POST
    • Get anomaly detection job results for categories GET
    • Get anomaly detection job results for categories POST
    • Get datafeed stats GET
    • Get datafeed stats GET
    • Get datafeeds configuration info GET
    • Get filters GET
    • Get anomaly detection job results for influencers GET
    • Get anomaly detection job results for influencers POST
    • Get anomaly detection job stats GET
    • Get anomaly detection job stats GET
    • Get anomaly detection jobs configuration info GET
    • Get anomaly detection job model snapshot upgrade usage info GET
    • Get model snapshots info GET
    • Get model snapshots info POST
    • Get overall bucket results GET
    • Get overall bucket results POST
    • Get anomaly records for an anomaly detection job GET
    • Get anomaly records for an anomaly detection job POST
    • Open anomaly detection jobs POST
    • Send data to an anomaly detection job for analysis POST
    • Preview a datafeed GET
    • Preview a datafeed POST
    • Preview a datafeed GET
    • Preview a datafeed POST
    • Reset an anomaly detection job POST
    • Revert to a snapshot POST
    • Start datafeeds POST
    • Stop datafeeds POST
    • Update a datafeed POST
    • Update a filter POST
    • Update an anomaly detection job POST
    • Update a snapshot POST
    • Upgrade a snapshot POST
  • Machine learning data frame analytics
    • Get data frame analytics job configuration info GET
    • Create a data frame analytics job PUT
    • Delete a data frame analytics job DELETE
    • Evaluate data frame analytics POST
    • Explain data frame analytics config GET
    • Explain data frame analytics config POST
    • Explain data frame analytics config GET
    • Explain data frame analytics config POST
    • Get data frame analytics job configuration info GET
    • Get data frame analytics job stats GET
    • Get data frame analytics job stats GET
    • Preview features used by data frame analytics GET
    • Preview features used by data frame analytics POST
    • Preview features used by data frame analytics GET
    • Preview features used by data frame analytics POST
    • Start a data frame analytics job POST
    • Stop data frame analytics jobs POST
    • Update a data frame analytics job POST
  • Machine learning trained model
    • Clear trained model deployment cache POST
    • Get trained model configuration info GET
    • Create a trained model PUT
    • Delete an unreferenced trained model DELETE
    • Create or update a trained model alias PUT
    • Delete a trained model alias DELETE
    • Get trained model configuration info GET
    • Get trained models usage info GET
    • Get trained models usage info GET
    • Evaluate a trained model POST
    • Evaluate a trained model POST
    • Create part of a trained model definition PUT
    • Create a trained model vocabulary PUT
    • Start a trained model deployment POST
    • Stop a trained model deployment POST
    • Update a trained model deployment POST
  • Migration
    • Cancel a migration reindex operation POST
    • Create an index from a source index PUT
    • Create an index from a source index POST
    • Get the migration reindexing status GET
    • Reindex legacy backing indices POST
    • Get deprecation information GET
    • Get deprecation information GET
    • Get feature migration information GET
    • Start the feature migration POST
  • Node lifecycle
    • Get the shutdown status GET
    • Prepare a node to be shut down PUT
    • Cancel node shutdown preparations DELETE
    • Get the shutdown status GET
  • Query rules
    • Get a query rule GET
    • Create or update a query rule PUT
    • Delete a query rule DELETE
    • Get a query ruleset GET
    • Create or update a query ruleset PUT
    • Delete a query ruleset DELETE
    • Get all query rulesets GET
    • Test a query ruleset POST
  • Rollup
    • Get rollup job information GET
    • Create a rollup job PUT
    • Delete a rollup job DELETE
    • Get rollup job information GET
    • Get the rollup job capabilities GET
    • Get the rollup job capabilities GET
    • Get the rollup index capabilities GET
    • Search rolled-up data GET
    • Search rolled-up data POST
    • Start rollup jobs POST
    • Stop rollup jobs POST
  • Script
    • Get a script or search template GET
    • Create or update a script or search template PUT
    • Create or update a script or search template POST
    • Delete a script or search template DELETE
    • Get script contexts GET
    • Get script languages GET
    • Create or update a script or search template PUT
    • Create or update a script or search template POST
    • Run a script GET
    • Run a script POST
  • Search
    • Get async search results GET
    • Delete an async search DELETE
    • Get the async search status GET
    • Run an async search POST
    • Run an async search POST
    • Run a scrolling search GET
    • Run a scrolling search POST
    • Clear a scrolling search DELETE
    • Run a scrolling search GET
    • Run a scrolling search POST
    • Clear a scrolling search DELETE
    • Close a point in time DELETE
    • Count search results GET
    • Count search results POST
    • Count search results GET
    • Count search results POST
    • Explain a document match result GET
    • Explain a document match result POST
    • Get the field capabilities GET
    • Get the field capabilities POST
    • Get the field capabilities GET
    • Get the field capabilities POST
    • Run a knn search GET
    • Run a knn search POST
    • Run multiple searches GET
    • Run multiple searches POST
    • Run multiple searches GET
    • Run multiple searches POST
    • Run multiple templated searches GET
    • Run multiple templated searches POST
    • Run multiple templated searches GET
    • Run multiple templated searches POST
    • Open a point in time POST
    • Evaluate ranked search results GET
    • Evaluate ranked search results POST
    • Evaluate ranked search results GET
    • Evaluate ranked search results POST
    • Render a search template GET
    • Render a search template POST
    • Render a search template GET
    • Render a search template POST
    • Run a search GET
    • Run a search POST
    • Run a search GET
    • Run a search POST
    • Search a vector tile GET
    • Search a vector tile POST
    • Get the search shards GET
    • Get the search shards POST
    • Get the search shards GET
    • Get the search shards POST
    • Run a search with a search template GET
    • Run a search with a search template POST
    • Run a search with a search template GET
    • Run a search with a search template POST
    • Get terms in an index GET
    • Get terms in an index POST
  • Search application
    • Get search application details GET
    • Create or update a search application PUT
    • Delete a search application DELETE
    • Get search applications GET
    • Render a search application query POST
    • Run a search application search GET
    • Run a search application search POST
  • Searchable snapshots
    • Get cache statistics GET
    • Get cache statistics GET
    • Clear the cache POST
    • Clear the cache POST
    • Mount a snapshot POST
    • Get searchable snapshot statistics GET
    • Get searchable snapshot statistics GET
  • Security
    • Activate a user profile POST
    • Authenticate a user GET
    • Get roles GET
    • Bulk create or update roles POST
    • Bulk delete roles DELETE
    • Bulk update API keys POST
    • Change passwords PUT
    • Change passwords POST
    • Change passwords PUT
    • Change passwords POST
    • Clear the API key cache POST
    • Clear the privileges cache POST
    • Clear the user cache POST
    • Clear the roles cache POST
    • Clear service account token caches POST
    • Get API key information GET
    • Create an API key PUT
    • Create an API key POST
    • Invalidate API keys DELETE
    • Create a cross-cluster API key POST
    • Create a service account token PUT
    • Create a service account token POST
    • Delete service account tokens DELETE
    • Create a service account token POST
    • Delegate PKI authentication POST
    • Get application privileges GET
    • Delete application privileges DELETE
    • Get roles GET
    • Create or update roles PUT
    • Create or update roles POST
    • Delete roles DELETE
    • Get role mappings GET
    • Create or update role mappings PUT
    • Create or update role mappings POST
    • Delete role mappings DELETE
    • Get users GET
    • Create or update users PUT
    • Create or update users POST
    • Delete users DELETE
    • Disable users PUT
    • Disable users POST
    • Disable a user profile PUT
    • Disable a user profile POST
    • Enable users PUT
    • Enable users POST
    • Enable a user profile PUT
    • Enable a user profile POST
    • Enroll Kibana GET
    • Enroll a node GET
    • Get builtin privileges GET
    • Get application privileges GET
    • Create or update application privileges PUT
    • Create or update application privileges POST
    • Get application privileges GET
    • Get role mappings GET
    • Get service accounts GET
    • Get service accounts GET
    • Get service accounts GET
    • Get service account credentials GET
    • Get security index settings GET
    • Update security index settings PUT
    • Get a token POST
    • Invalidate a token DELETE
    • Get users GET
    • Get user privileges GET
    • Get a user profile GET
    • Grant an API key POST
    • Check user privileges GET
    • Check user privileges POST
    • Check user privileges GET
    • Check user privileges POST
    • Check user profile privileges GET
    • Check user profile privileges POST
    • Authenticate OpenID Connect POST
    • Logout of OpenID Connect POST
    • Prepare OpenID connect authentication POST
    • Find API keys with a query GET
    • Find API keys with a query POST
    • Find roles with a query GET
    • Find roles with a query POST
    • Find users with a query GET
    • Find users with a query POST
    • Authenticate SAML POST
    • Logout of SAML completely POST
    • Invalidate SAML POST
    • Logout of SAML POST
    • Prepare SAML authentication POST
    • Create SAML service provider metadata GET
    • Suggest a user profile GET
    • Suggest a user profile POST
    • Update an API key PUT
    • Update a cross-cluster API key PUT
    • Update user profile data PUT
    • Update user profile data POST
    • Get SSL certificates GET
  • Snapshot and restore
    • Clean up the snapshot repository POST
    • Clone a snapshot PUT
    • Get snapshot information GET
    • Create a snapshot PUT
    • Create a snapshot POST
    • Delete snapshots DELETE
    • Get snapshot repository information GET
    • Create or update a snapshot repository PUT
    • Create or update a snapshot repository POST
    • Delete snapshot repositories DELETE
    • Get snapshot repository information GET
    • Analyze a snapshot repository POST
    • Restore a snapshot POST
    • Get the snapshot status GET
    • Get the snapshot status GET
    • Get the snapshot status GET
    • Verify a snapshot repository POST
  • Snapshot lifecycle management
    • Get policy information GET
    • Create or update a policy PUT
    • Delete a policy DELETE
    • Run a policy PUT
    • Run a retention policy POST
    • Get policy information GET
    • Get snapshot lifecycle management statistics GET
    • Get the snapshot lifecycle management status GET
    • Start snapshot lifecycle management POST
    • Stop snapshot lifecycle management POST
  • SQL
    • Clear an SQL search cursor POST
    • Delete an async SQL search DELETE
    • Get async SQL search results GET
    • Get the async SQL search status GET
    • Get SQL search results GET
    • Get SQL search results POST
    • Translate SQL into Elasticsearch queries GET
    • Translate SQL into Elasticsearch queries POST
  • Synonyms
    • Get a synonym set GET
    • Create or update a synonym set PUT
    • Delete a synonym set DELETE
    • Get a synonym rule GET
    • Create or update a synonym rule PUT
    • Delete a synonym rule DELETE
    • Get all synonym sets GET
  • Task management
    • Cancel a task POST
    • Cancel a task POST
    • Get task information GET
    • Get all tasks GET
  • Text structure
    • Find the structure of a text field GET
    • Find the structure of text messages GET
    • Find the structure of text messages POST
    • Find the structure of a text file POST
    • Test a Grok pattern GET
    • Test a Grok pattern POST
  • Transform
    • Get transforms GET
    • Create a transform PUT
    • Delete a transform DELETE
    • Get transforms GET
    • Get transform stats GET
    • Preview a transform GET
    • Preview a transform POST
    • Preview a transform GET
    • Preview a transform POST
    • Reset a transform POST
    • Schedule a transform to start now POST
    • Start a transform POST
    • Stop transforms POST
    • Update a transform POST
    • Upgrade all transforms POST
  • Usage
    • Get information GET
    • Get usage information GET
  • Watcher
    • Acknowledge a watch PUT
    • Acknowledge a watch POST
    • Acknowledge a watch PUT
    • Acknowledge a watch POST
    • Activate a watch PUT
    • Activate a watch POST
    • Deactivate a watch PUT
    • Deactivate a watch POST
    • Get a watch GET
    • Create or update a watch PUT
    • Create or update a watch POST
    • Delete a watch DELETE
    • Run a watch PUT
    • Run a watch POST
    • Run a watch PUT
    • Run a watch POST
    • Get Watcher index settings GET
    • Update Watcher index settings PUT
    • Query watches GET
    • Query watches POST
    • Start the watch service POST
    • Get Watcher statistics GET
    • Get Watcher statistics GET
    • Stop the watch service POST
Powered by Bump.sh

Run a search

GET /_search
Api key auth Basic auth Bearer auth

Get search hits that match the query defined in the request. You can provide search queries using the q query string parameter or the request body. If both are specified, only the query parameter is used.

If the Elasticsearch security features are enabled, you must have the read index privilege for the target data stream, index, or alias. For cross-cluster search, refer to the documentation about configuring CCS privileges. To search a point in time (PIT) for an alias, you must have the read index privilege for the alias's data streams or indices.

Search slicing

When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the slice and pit properties. By default the splitting is done first on the shards, then locally on each shard. The local splitting partitions the shard into contiguous ranges based on Lucene document IDs.

For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard.

IMPORTANT: The same point-in-time ID should be used for all slices. If different PIT IDs are used, slices can overlap and miss documents. This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index.

External documentation

Query parameters

  • allow_no_indices boolean

    If false, the request returns an error if any wildcard expression, index alias, or _all value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar.

  • allow_partial_search_results boolean

    If true and there are shard request timeouts or shard failures, the request returns partial results. If false, it returns an error with no partial results.

    To override the default behavior, you can set the search.default_allow_partial_results cluster setting to false.

  • analyzer string

    The analyzer to use for the query string. This parameter can be used only when the q query string parameter is specified.

  • analyze_wildcard boolean

    If true, wildcard and prefix queries are analyzed. This parameter can be used only when the q query string parameter is specified.

  • batched_reduce_size number

    The number of shard results that should be reduced at once on the coordinating node. If the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request.

  • ccs_minimize_roundtrips boolean

    If true, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests.

  • default_operator string

    The default operator for the query string query: AND or OR. This parameter can be used only when the q query string parameter is specified.

    Values are and, AND, or, or OR.

  • df string

    The field to use as a default when no field prefix is given in the query string. This parameter can be used only when the q query string parameter is specified.

  • 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]

    The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. It supports comma-separated values such as open,hidden.

  • explain boolean

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

  • ignore_throttled boolean Deprecated

    If true, concrete, expanded or aliased indices will be ignored when frozen.

  • ignore_unavailable boolean

    If false, the request returns an error if it targets a missing or closed index.

  • include_named_queries_score boolean

    If true, the response includes the score contribution from any named queries.

    This functionality reruns each named query on every hit in a search response. Typically, this adds a small overhead to a request. However, using computationally expensive named queries on a large number of hits may add significant overhead.

  • lenient boolean

    If true, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. This parameter can be used only when the q query string parameter is specified.

  • max_concurrent_shard_requests number

    The number of concurrent shard requests per node that the search runs 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.

  • min_compatible_shard_node string

    The minimum version of the node that can handle the request Any handling node with a lower version will fail the request.

  • preference string

    The nodes and shards used for the search. By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. Valid values are:

    • _only_local to run the search only on shards on the local node;
    • _local to, if possible, run the search on shards on the local node, or if not, select shards using the default method;
    • _only_nodes:<node-id>,<node-id> to run the search on only the specified nodes IDs, where, if suitable shards exist on more than one selected node, use shards on those nodes using the default method, or if none of the specified nodes are available, select shards from any available node using the default method;
    • _prefer_nodes:<node-id>,<node-id> to if possible, run the search on the specified nodes IDs, or if not, select shards using the default method;
    • _shards:<shard>,<shard> to run the search only on the specified shards;
    • <custom-string> (any string that does not start with _) to route searches with the same <custom-string> to the same shards in the same order.
  • pre_filter_shard_size number

    A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). When unspecified, the pre-filter phase is executed if any of these conditions is met:

    • The request targets more than 128 shards.
    • The request targets one or more read-only index.
    • The primary sort of the query targets an indexed field.
  • request_cache boolean

    If true, the caching of search results is enabled for requests where size is 0. It defaults to index level settings.

  • routing string

    A custom value that is used to route operations to a specific shard.

  • scroll string

    The period to retain the search context for scrolling. By default, this value cannot exceed 1d (24 hours). You can change this limit by using the search.max_keep_alive cluster-level setting.

  • search_type string

    Indicates how distributed term frequencies are calculated for relevance scoring.

    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. 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.

  • suggest_field string

    The field to use for suggestions.

  • suggest_mode string

    The suggest mode. This parameter can be used only when the suggest_field and suggest_text query string parameters are specified.

    Values are missing, popular, or always.

  • suggest_size number

    The number of suggestions to return. This parameter can be used only when the suggest_field and suggest_text query string parameters are specified.

  • suggest_text string

    The source text for which the suggestions should be returned. This parameter can be used only when the suggest_field and suggest_text query string parameters are specified.

  • terminate_after number

    The 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.

    IMPORTANT: Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. If set to 0 (default), the query does not terminate early.

  • timeout string

    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. It defaults to no timeout.

  • track_total_hits boolean | number

    The 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.

  • track_scores boolean

    If true, the request calculates and returns document scores, even if the scores are not used for sorting.

  • typed_keys boolean

    If true, aggregation and suggester names are 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

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

  • _source boolean | string | array[string]

    The source fields that are returned for matching documents. These fields are returned in the hits._source property of the search response. Valid values are:

    • true to return the entire document source.
    • false to not return the document source.
    • <string> to return the source fields that are specified as a comma-separated list that supports wildcard (*) patterns.
  • _source_excludes string | array[string]

    A comma-separated list of source fields to exclude from the response. You can also use this parameter to exclude fields from the subset specified in _source_includes query parameter. If the _source parameter is false, this parameter is ignored.

  • _source_includes string | array[string]

    A comma-separated list of source fields to include in the response. If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the _source_excludes query parameter. If the _source parameter is false, this parameter is ignored.

  • seq_no_primary_term boolean

    If true, the request returns the sequence number and primary term of the last modification of each hit.

  • q string

    A query in the Lucene query string syntax. Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.

    IMPORTANT: This parameter overrides the query parameter in the request body. If both parameters are specified, documents matching the query request body parameter are not returned.

  • 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.

  • from number

    The starting document offset, which must be non-negative. 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.

  • sort string | array[string]

    A comma-separated list of <field>:<direction> pairs.

application/json

Body

  • aggregations object

    Defines the aggregations that are run as part of the search request.

  • collapse object
    External documentation
  • explain boolean

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

  • ext object

    Configuration of search extensions defined by Elasticsearch plugins.

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

    The starting document offset, which must be non-negative. 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
    Hide highlight attributes Show highlight attributes object
    • type string

      Any of:
      HighlighterType string HighlighterType string

      Values are plain, fvh, or unified.

    • boundary_chars string

      A string that contains each boundary character.

    • boundary_max_scan number

      How far to scan for boundary characters.

    • boundary_scanner string

      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".

    • force_source boolean Deprecated
    • fragmenter string

      Values are simple or span.

    • fragment_size number

      The size of the highlighted fragment in characters.

    • highlight_filter boolean
    • highlight_query object

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

      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.

    • 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.

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

      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.

    • 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.

    • tags_schema string

      Value is styled.

    • encoder string

      Values are default or html.

    • fields 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]

    Boost the _score of documents from specified indices. The boost value is the factor by which scores are multiplied. A boost value greater than 1.0 increases the score. A boost value between 0 and 1.0 decreases the score.

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

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

    External documentation
    Hide docvalue_fields attributes Show docvalue_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

      The format in which the values are returned.

    • include_unmapped boolean
  • knn object | array[object]

    The approximate kNN search to run.

    One of:
    KnnSearch object array-2 array[object]
    Hide attributes Show attributes
    • field string Required

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

    • query_vector array[number]
    • query_vector_builder object
      Hide query_vector_builder attribute Show query_vector_builder attribute object
      • text_embedding object
        Hide text_embedding attributes Show text_embedding attributes object
        • model_id string Required
        • model_text string Required
    • 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

    • boost number

      Boost value to apply to kNN scores

    • filter object | array[object]

      Filters for the kNN search query

      One of:
      QueryContainer object array-2 array[object]

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

      External documentation

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

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

      External documentation
    • similarity number

      The minimum similarity for a vector to be considered a match

    • inner_hits object
      Hide inner_hits attributes Show inner_hits attributes object
      • name string
      • size number

        The maximum number of hits to return per inner_hits.

      • from number

        Inner hit starting document offset.

      • collapse object
        External documentation
      • docvalue_fields array[object]
        Hide docvalue_fields attributes Show docvalue_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

          The format in which the values are returned.

        • include_unmapped boolean
      • explain boolean
      • highlight object
        Hide highlight attributes Show highlight attributes object
        • type string

          Any of:
          HighlighterType string HighlighterType string

          Values are plain, fvh, or unified.

        • boundary_chars string

          A string that contains each boundary character.

        • boundary_max_scan number

          How far to scan for boundary characters.

        • boundary_scanner string

          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".

        • force_source boolean Deprecated
        • fragmenter string

          Values are simple or span.

        • fragment_size number

          The size of the highlighted fragment in characters.

        • highlight_filter boolean
        • highlight_query object

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

          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.

        • 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.

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

          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.

        • 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.

        • tags_schema string

          Value is styled.

        • encoder string

          Values are default or html.

        • fields object Required
      • ignore_unmapped boolean
      • script_fields object
        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

              The script source.

            • id string
            • 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.

            • lang
            • options object
          • ignore_failure boolean
      • 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 string | object | array[string | object]

        One of:
        Field string SortOptions object Sort array[string | object]

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

        Hide attributes Show attributes
        • _score object
        • _doc object
        • _geo_distance object
        • _script object
        One of:
        Field string SortOptions object

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

      • _source boolean | object

        Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

        One of:
        SourceConfig boolean SourceFilter object
        Hide attributes Show attributes
        • excludes string | array[string]
        • includes string | array[string]
      • stored_fields string | array[string]
      • track_scores boolean
      • version boolean
    • rescore_vector object
      Hide rescore_vector attribute Show rescore_vector attribute object
      • oversample number Required

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

    External documentation
    Hide attributes Show attributes object
    • field string Required

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

    • query_vector array[number]
    • query_vector_builder object
      Hide query_vector_builder attribute Show query_vector_builder attribute object
      • text_embedding object
        Hide text_embedding attributes Show text_embedding attributes object
        • model_id string Required
        • model_text string Required
    • 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

    • boost number

      Boost value to apply to kNN scores

    • filter object | array[object]

      Filters for the kNN search query

      One of:
      QueryContainer object array-2 array[object]

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

      External documentation

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

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

      External documentation
    • similarity number

      The minimum similarity for a vector to be considered a match

    • inner_hits object
      Hide inner_hits attributes Show inner_hits attributes object
      • name string
      • size number

        The maximum number of hits to return per inner_hits.

      • from number

        Inner hit starting document offset.

      • collapse object
        External documentation
      • docvalue_fields array[object]
        Hide docvalue_fields attributes Show docvalue_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

          The format in which the values are returned.

        • include_unmapped boolean
      • explain boolean
      • highlight object
        Hide highlight attributes Show highlight attributes object
        • type
        • boundary_chars string

          A string that contains each boundary character.

        • boundary_max_scan number

          How far to scan for boundary characters.

        • boundary_scanner string

          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".

        • force_source boolean Deprecated
        • fragmenter string

          Values are simple or span.

        • fragment_size number

          The size of the highlighted fragment in characters.

        • highlight_filter boolean
        • highlight_query object

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

        • 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.

        • 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.

        • options object
        • order string

          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.

        • 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.

        • tags_schema string

          Value is styled.

        • encoder string

          Values are default or html.

        • fields object Required
      • ignore_unmapped boolean
      • script_fields object
        Hide script_fields attribute Show script_fields attribute object
        • * object Additional properties
          Hide * attributes Show * attributes object
          • script object Required
          • ignore_failure boolean
      • 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 string | object | array[string | object]

        One of:
        Field string SortOptions object Sort array[string | object]

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

      • _source boolean | object

        Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

        One of:
        SourceConfig boolean SourceFilter object
        Hide attributes Show attributes
        • excludes string | array[string]
        • includes string | array[string]
      • stored_fields string | array[string]
      • track_scores boolean
      • version boolean
    • rescore_vector object
      Hide rescore_vector attribute Show rescore_vector attribute object
      • oversample number Required

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

  • rank object
    Hide rank attribute Show rank attribute object
    • rrf object
      Hide rrf attributes Show rrf attributes object
      • rank_constant number

        How much influence documents in individual result sets per query have over the final ranked result set

      • rank_window_size number

        Size of the individual result sets per query

  • min_score number

    The minimum _score for matching documents. Documents with a lower _score are not included in the search results.

  • post_filter object

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

    External documentation
  • profile boolean

    Set to true to return detailed timing information about the execution of individual components in a search request. NOTE: This is a debugging tool and adds significant overhead to search execution.

  • query object

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

    External documentation
  • rescore object | array[object]

    Can be used to improve precision by reordering just the top (for example 100 - 500) documents returned by the query and post_filter phases.

    One of:
    Rescore object array-2 array[object]
    Hide attributes Show attributes
    • window_size number
    • query object
      Hide query attributes Show query attributes object
      • rescore_query object Required

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

        External documentation
      • query_weight number

        Relative importance of the original query versus the rescore query.

      • rescore_query_weight number

        Relative importance of the rescore query versus the original query.

      • score_mode string

        Values are avg, max, min, multiply, or total.

    • 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

        Hide params attribute Show params attribute object
        • * object Additional properties
    Hide attributes Show attributes object
    • window_size number
    • query object
      Hide query attributes Show query attributes object
      • rescore_query object Required

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

        External documentation
      • query_weight number

        Relative importance of the original query versus the rescore query.

      • rescore_query_weight number

        Relative importance of the rescore query versus the original query.

      • score_mode string

        Values are avg, max, min, multiply, or total.

    • 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

        Hide params attribute Show params attribute object
        • * object Additional properties
  • retriever object
    Hide retriever attributes Show retriever attributes object
    • standard object
      Hide standard attributes Show standard attributes object
      • filter object | array[object]

        Query to filter the documents that can match.

        One of:
        QueryContainer object array-2 array[object]

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

        External documentation

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

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

        External documentation
      • min_score number

        Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.

      • query object

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

        External documentation
      • search_after array[number | string | boolean | null | object]

        A field value.

        A field value.

        One of:
        FieldValue number FieldValue number FieldValue string FieldValue boolean FieldValue string | null FieldValue object
      • terminate_after number

        Maximum number of documents to collect for each shard.

      • sort string | object | array[string | object]

        One of:
        Field string SortOptions object Sort array[string | object]

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

        Hide attributes Show attributes
        • _score object
        • _doc object
        • _geo_distance object
        • _script object
        One of:
        Field string SortOptions object

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

      • collapse object
        External documentation
    • knn object
      Hide knn attributes Show knn attributes object
      • filter object | array[object]

        Query to filter the documents that can match.

        One of:
        QueryContainer object array-2 array[object]

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

        External documentation

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

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

        External documentation
      • min_score number

        Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.

      • field string Required

        The name of the vector field to search against.

      • query_vector array[number]
      • query_vector_builder object
        Hide query_vector_builder attribute Show query_vector_builder attribute object
        • text_embedding object
          Hide text_embedding attributes Show text_embedding attributes object
          • model_id string Required
          • model_text string Required
      • k number Required

        Number of nearest neighbors to return as top hits.

      • num_candidates number Required

        Number of nearest neighbor candidates to consider per shard.

      • similarity number

        The minimum similarity required for a document to be considered a match.

      • rescore_vector object
        Hide rescore_vector attribute Show rescore_vector attribute object
        • oversample number Required

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

    • rrf object
      Hide rrf attributes Show rrf attributes object
      • filter object | array[object]

        Query to filter the documents that can match.

        One of:
        QueryContainer object array-2 array[object]

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

        External documentation

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

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

        External documentation
      • min_score number

        Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.

      • retrievers array[object] Required

        A list of child retrievers to specify which sets of returned top documents will have the RRF formula applied to them.

      • rank_constant number

        This value determines how much influence documents in individual result sets per query have over the final ranked result set.

      • rank_window_size number

        This value determines the size of the individual result sets per query.

    • text_similarity_reranker object
      Hide text_similarity_reranker attributes Show text_similarity_reranker attributes object
      • filter object | array[object]

        Query to filter the documents that can match.

        One of:
        QueryContainer object array-2 array[object]

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

        External documentation

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

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

        External documentation
      • min_score number

        Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.

      • retriever object Required
      • rank_window_size number

        This value determines how many documents we will consider from the nested retriever.

      • inference_id string

        Unique identifier of the inference endpoint created using the inference API.

      • inference_text string

        The text snippet used as the basis for similarity comparison

      • field string

        The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text

    • rule object
      Hide rule attributes Show rule attributes object
      • filter object | array[object]

        Query to filter the documents that can match.

        One of:
        QueryContainer object array-2 array[object]

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

        External documentation

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

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

        External documentation
      • min_score number

        Minimum _score for matching documents. Documents with a lower _score are not included in the top documents.

      • ruleset_ids array[string] Required

        The ruleset IDs containing the rules this retriever is evaluating against.

      • match_criteria object Required

        The match criteria that will determine if a rule in the provided rulesets should be applied.

      • retriever object Required
      • rank_window_size number

        This value determines the size of the individual result set.

  • 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

          The script source.

        • id string
        • 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

          Any of:
          ScriptLanguage string ScriptLanguage string

          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 | object]

    A field value.

    A field value.

    One of:
    FieldValue number FieldValue number FieldValue string FieldValue boolean FieldValue string | null FieldValue object
  • size number

    The number of hits to return, which must not be negative. 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 property.

  • 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:
    Field string SortOptions object Sort array[string | object]

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

    Hide attributes Show attributes
    • _score object
      Hide _score attribute Show _score attribute object
      • order string

        Values are asc or desc.

    • _doc object
      Hide _doc attribute Show _doc attribute object
      • order string

        Values are asc or desc.

    • _geo_distance object
      Hide _geo_distance attributes Show _geo_distance attributes object
      • mode string

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

      • distance_type string

        Values are arc or plane.

      • ignore_unmapped boolean
      • order string

        Values are asc or desc.

      • unit string

        Values are in, ft, yd, mi, nmi, km, m, cm, or mm.

      • nested object
        Hide nested attributes Show nested attributes object
        • filter object

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

          External documentation
        • max_children number
        • nested object
        • path string Required

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

    • _script object
      Hide _script attributes Show _script attributes object
      • order string

        Values are asc or desc.

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

          The script source.

        • id string
        • 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

          Any of:
          ScriptLanguage string ScriptLanguage string

          Values are painless, expression, mustache, or java.

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

        Values are string, number, or version.

      • mode string

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

      • nested object
        Hide nested attributes Show nested attributes object
        • filter object

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

          External documentation
        • max_children number
        • nested object
        • path string Required

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

    One of:
    Field string SortOptions object

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

    Hide attributes Show attributes
    • _score object
      Hide _score attribute Show _score attribute object
      • order string

        Values are asc or desc.

    • _doc object
      Hide _doc attribute Show _doc attribute object
      • order string

        Values are asc or desc.

    • _geo_distance object
      Hide _geo_distance attributes Show _geo_distance attributes object
      • mode string

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

      • distance_type string

        Values are arc or plane.

      • ignore_unmapped boolean
      • order string

        Values are asc or desc.

      • unit string

        Values are in, ft, yd, mi, nmi, km, m, cm, or mm.

      • nested object
        Hide nested attributes Show nested attributes object
        • filter object

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

        • max_children number
        • nested object
        • path string Required

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

    • _script object
      Hide _script attributes Show _script attributes object
      • order string

        Values are asc or desc.

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

          The script source.

        • id string
        • 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.

        • lang
        • options object
      • type string

        Values are string, number, or version.

      • mode string

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

      • nested object
        Hide nested attributes Show nested attributes object
        • filter object

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

        • max_children number
        • nested object
        • path string Required

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

  • _source boolean | object

    Defines how to fetch a source. Fetching can be disabled entirely, or the source can be filtered.

    One of:
    SourceConfig boolean SourceFilter object
    Hide attributes Show attributes
    • excludes string | array[string]
    • includes string | array[string]
  • fields array[object]

    An array of wildcard (*) field 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
    • field string Required

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

    • 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

    The 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.

    IMPORTANT: Use with caution. Elasticsearch applies this property to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this property for requests that target data streams with backing indices across multiple data tiers.

    If set to 0 (default), the query does not terminate early.

  • timeout string

    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, the request returns the document version as part of a hit.

  • seq_no_primary_term boolean

    If true, the request returns sequence number and primary term of the last modification of each hit.

    External documentation
  • stored_fields string | array[string]
  • pit object
    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.

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

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

      • target_field string

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

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

          The script source.

        • id string
        • 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

          Any of:
          ScriptLanguage string ScriptLanguage string

          Values are painless, expression, mustache, or java.

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

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

  • stats array[string]

    The 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
    • took number Required

      The number of milliseconds it took Elasticsearch to run the request. This value is calculated by measuring the time elapsed between receipt of a request on the coordinating node and the time at which the coordinating node is ready to send the response. It includes:

      • Communication time between the coordinating node and data nodes
      • Time the request spends in the search thread pool, queued for execution
      • Actual run time

      It does not include:

      • Time needed to send the request to Elasticsearch
      • Time needed to serialize the JSON response
      • Time needed to send the response to a client
    • timed_out boolean Required

      If true, the request timed out before completion; returned results may be partial or empty.

    • _shards object Required
      Hide _shards attributes Show _shards attributes object
      • failed number Required
      • successful number Required
      • total number Required
      • failures array[object]
        Hide failures attributes Show failures attributes object
        • index string
        • node string
        • reason object Required
          Hide reason attributes Show reason attributes object
          • type string Required

            The type of error

          • reason string

            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
          • root_cause array[object]
          • suppressed array[object]
        • shard number Required
        • status string
      • skipped number
    • hits object Required
      Hide hits attributes Show hits attributes object
      • total object | number

        Total hit count information, present only if track_total_hits wasn't false in the search request.

        One of:
        TotalHits object number-2 number
        Hide attributes Show attributes
        • relation string Required

          Values are eq or gte.

        • value number Required
      • hits array[object] Required
        Hide hits attributes Show hits attributes object
        • _index string Required
        • _id string
        • _score number | string | null

          One of:
          number-1 number string-2 string | null
        • _explanation object
          Hide _explanation attributes Show _explanation attributes object
          • description string Required
          • details array[object] Required
          • value number Required
        • fields object
          Hide fields attribute Show fields attribute object
          • * object Additional properties
        • highlight object
          Hide highlight attribute Show highlight attribute object
          • * array[string] Additional properties
        • inner_hits object
          Hide inner_hits attribute Show inner_hits attribute object
          • * object Additional properties
            Hide * attribute Show * attribute object
            • hits object Required
        • matched_queries array[string] | object

          One of:
          array-1 array[string] object-2 object
          Hide attribute Show attribute
          • * number Additional properties
        • _nested object
          Hide _nested attributes Show _nested attributes object
          • field string Required

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

          • offset number Required
          • _nested object
        • _ignored array[string]
        • ignored_field_values object
          Hide ignored_field_values attribute Show ignored_field_values attribute object
          • * array[number | string | boolean | null | object] Additional properties

            A field value.

        • _shard string
        • _node string
        • _routing string
        • _source object
        • _rank number
        • _seq_no number
        • _primary_term number
        • _version number
        • sort array[number | string | boolean | null | object]

          A field value.

          A field value.

          One of:
          FieldValue number FieldValue number FieldValue string FieldValue boolean FieldValue string | null FieldValue object
      • max_score number | string | null

        One of:
        number-1 number string-2 string | null
    • aggregations object
    • _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
        Hide details attribute Show details attribute object
        • * object Additional properties
          Hide * attributes Show * attributes object
          • status string Required

            Values are running, successful, partial, skipped, or failed.

          • indices string Required
          • took number

            Time unit for milliseconds

          • timed_out boolean Required
          • _shards object
            Hide _shards attributes Show _shards attributes object
            • failed number Required
            • successful number Required
            • total number Required
            • failures array[object]
            • skipped number
          • failures array[object]
            Hide failures attributes Show failures attributes object
            • index string
            • node string
            • reason object Required
            • shard number Required
            • status string
    • fields object
      Hide fields attribute Show fields attribute object
      • * object Additional properties
    • max_score number
    • num_reduce_phases number
    • profile object
      Hide profile attribute Show profile attribute object
      • shards array[object] Required
        Hide shards attributes Show shards attributes object
        • aggregations array[object] Required
          Hide aggregations attributes Show aggregations attributes object
          • breakdown object Required
          • description string Required
          • time_in_nanos
          • type string Required
          • debug object
          • children array[object]
        • cluster string Required
        • dfs object
          Hide dfs attributes Show dfs attributes object
          • statistics object
            Hide statistics attributes Show statistics attributes object
            • type string Required
            • description string Required
            • time 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.

            • time_in_nanos
            • breakdown object Required
            • debug object
            • children array[object]
          • knn array[object]
        • fetch object
          Hide fetch attributes Show fetch attributes object
          • type string Required
          • description string Required
          • time_in_nanos number

            Time unit for nanoseconds

          • breakdown object Required
            Hide breakdown attributes Show breakdown attributes object
            • load_source number
            • load_source_count number
            • load_stored_fields number
            • load_stored_fields_count number
            • next_reader number
            • next_reader_count number
            • process_count number
            • process number
          • debug object
            Hide debug attributes Show debug attributes object
            • stored_fields array[string]
            • fast_path number
          • children array[object]
        • id string Required
        • index string Required
        • node_id string Required
        • searches array[object] Required
          Hide searches attributes Show searches attributes object
          • collector array[object] Required
          • query array[object] Required
          • rewrite_time number Required
        • shard_id number Required
    • pit_id string
    • _scroll_id string
    • suggest object
      Hide suggest attribute Show suggest attribute object
      • * array[object] Additional properties
        One of:
        CompletionSuggest object PhraseSuggest object TermSuggest object
        Hide attributes Show attributes
        • length number Required
        • offset number Required
        • text string Required
        • options
        Hide attributes Show attributes
        • length number Required
        • offset number Required
        • text string Required
        • options
        Hide attributes Show attributes
        • length number Required
        • offset number Required
        • text string Required
        • options
    • terminated_early boolean
GET /_search
curl \
 --request GET 'http://api.example.com/_search' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '"{\n  \"query\": {\n    \"term\": {\n      \"user.id\": \"kimchy\"\n    }\n  }\n}"'
Request examples
A simple term search
  • A simple term search
  • A point in time search
  • Search slicing
Run `GET /my-index-000001/_search?from=40&size=20` to run a search.
{
  "query": {
    "term": {
      "user.id": "kimchy"
    }
  }
}
Run `POST /_search` to run a point in time search. The `id` parameter tells Elasticsearch to run the request using contexts from this open point in time. The `keep_alive` parameter tells Elasticsearch how long it should extend the time to live of the point in time.
{
    "size": 100,  
    "query": {
        "match" : {
            "title" : "elasticsearch"
        }
    },
    "pit": {
      "id":  "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA==", 
      "keep_alive": "1m"  
    }
}
When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently. The result from running the first `GET /_search` request returns documents belonging to the first slice (`id: 0`). If you run a second request with `id` set to `1', it returns documents in the second slice. Since the maximum number of slices is set to `2`, the union of the results is equivalent to the results of a point-in-time search without slicing.
{
  "slice": {
    "id": 0,                      
    "max": 2                      
  },
  "query": {
    "match": {
      "message": "foo"
    }
  },
  "pit": {
    "id": "46ToAwMDaWR5BXV1aWQyKwZub2RlXzMAAAAAAAAAACoBYwADaWR4BXV1aWQxAgZub2RlXzEAAAAAAAAAAAEBYQADaWR5BXV1aWQyKgZub2RlXzIAAAAAAAAAAAwBYgACBXV1aWQyAAAFdXVpZDEAAQltYXRjaF9hbGw_gAAAAA=="
  }
}
Response examples (200)
An abbreviated response from `GET /my-index-000001/_search?from=40&size=20` with a simple term query.
{
  "took": 5,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 20,
      "relation": "eq"
    },
    "max_score": 1.3862942,
    "hits": [
      {
        "_index": "my-index-000001",
        "_id": "0",
        "_score": 1.3862942,
        "_source": {
          "@timestamp": "2099-11-15T14:12:12",
          "http": {
            "request": {
              "method": "get"
            },
            "response": {
              "status_code": 200,
              "bytes": 1070000
            },
            "version": "1.1"
          },
          "source": {
            "ip": "127.0.0.1"
          },
          "message": "GET /search HTTP/1.1 200 1070000",
          "user": {
            "id": "kimchy"
          }
        }
      }
    ]
  }
}