Elastic Stack (ELK Stack) Search API
The search API from Elastic Stack (ELK Stack) — 29 operation(s) for search.
Operations 55
Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay
Ask an LLM
“How do I retrieve the hits from an async search I submitted earlier?”
“Can I wait a few seconds for an async search to finish before its results come back?”
Tell an agent
Get the results of async search {id}.
Fetch async search {id} results, waiting up to {wait_for_completion_timeout} for completion.
Ask an LLM
“How do I cancel an async search that is still running?”
“Can I delete the saved results of a finished async search?”
Tell an agent destructive · confirm first
Delete async search {id}.
Cancel the running asynchronous search {id} and discard its stored results.
Ask an LLM
“Is my async search still running, without pulling back its hits?”
“What is the completion status of a submitted asynchronous search?”
Tell an agent
Check the status of async search {id}.
Tell me if asynchronous search {id} has completed, without returning results.
Ask an LLM
“How do I run a long search in the background across the whole cluster?”
“Can an async search keep its results after it completes?”
Tell an agent
Submit an async search across all indices for {q}.
Start a background cluster-wide search with query {query} and keep results for {keep_alive}.
Ask an LLM
“How do I launch an asynchronous search limited to one index or data stream?”
“Can I get partial results from a background search on a single index while it runs?”
Tell an agent
Submit an async search on index {index} for {q}.
Run query {query} asynchronously against {index} only.
Ask an LLM
“How do I fetch the next page of a scrolling search using a GET request?”
“Is the scroll API still recommended for paging past 10,000 hits?”
Tell an agent
Get the next scroll page for scroll ID {scroll_id} with a GET.
Continue scrolling {scroll_id} via GET and keep the context alive for {scroll}.
Ask an LLM
“Can I POST a scroll ID in the body to retrieve the next batch of hits?”
“What body fields does the POST scroll request take?”
Tell an agent
POST scroll_id {scroll_id} to pull the next batch of results.
Advance my scrolling search {scroll_id} with a POST body, extending it by {scroll}.
Ask an LLM
“How do I free the resources held by open scroll contexts?”
“Can I clear several scrolling searches by listing their IDs in the body?”
Tell an agent destructive · confirm first
Clear the scroll contexts {scroll_id}.
Release all the scrolling search contexts listed in the request body.
GET
/_search/scroll/{scroll_id}
Get the next scroll batch by ID in the path (GET) · Run a scrolling search
#
Ask an LLM
“Can I put the scroll ID in the URL path of a GET to keep paging?”
“What does the GET scroll endpoint with an ID in the path return?”
Tell an agent
GET /_search/scroll/{path_scroll_id} to fetch the next page, body scroll_id {scroll_id}.
Page forward through scroll {path_scroll_id} using the path-ID GET variant.
POST
/_search/scroll/{scroll_id}
Get the next scroll batch by ID in the path (POST) · Run a scrolling search
#
Ask an LLM
“Is there a POST scroll endpoint that takes the scroll ID in the path?”
“Can I POST to a scroll URL that includes the ID to get more hits?”
Tell an agent
POST to /_search/scroll/{path_scroll_id} for the next hits, with body scroll_id {scroll_id}.
Retrieve more scroll results for {path_scroll_id} through the path-ID POST form.
DELETE
/_search/scroll/{scroll_id}
Clear a scroll context by ID in the path · Clear a scrolling search
#
Ask an LLM
“Can I clear one scroll by putting its ID in the URL?”
“How do I delete a specific scroll search context by path?”
Tell an agent destructive · confirm first
Clear scroll {scroll_id} via its path.
Free the search context for scroll ID {scroll_id} given in the URL.
Ask an LLM
“How do I close a point in time before its keep_alive expires?”
“Why should I close PITs as soon as I finish searching with them?”
Tell an agent destructive · confirm first
Close point in time {id}.
Release the PIT {id} now that pagination is done.
Ask an LLM
“How many documents across the cluster match a simple query string?”
“Can I count every document in all indices with a quick GET?”
Tell an agent
Count documents across all indices matching {q}.
Give me the total document count for the whole cluster using GET.
Ask an LLM
“Can I count cluster-wide matches by POSTing Query DSL in the body?”
“What does the count API return when I post no query at all?”
Tell an agent
POST query {query} to count hits in every index.
Tally all-index matches for this Query DSL body {query}, stopping after {terminate_after} per shard.
Ask an LLM
“How many documents are in one specific index?”
“Can I count hits in a data stream with a q parameter on a GET?”
Tell an agent
Count the documents in index {index}.
Using GET, count how many docs in {index} match {q}.
Ask an LLM
“Can I POST a Query DSL body to count matches inside one index?”
“How do I count documents in a data stream using a request body query?”
Tell an agent
POST query {query} to count matching docs in {index}.
Tally hits in index {index} for body query {query} with min score {min_score}.
GET
/{index}/_explain/{id}
Explain a document's match with a query string · Explain a document match result
#
Ask an LLM
“Why does a particular document match my query string, and how was it scored?”
“Can I see a score explanation for one document using a GET request?”
Tell an agent
Explain why document {id} in {index} matches {q}.
Show the relevance score breakdown of doc {id} from index {index} via GET.
POST
/{index}/_explain/{id}
Explain a document's match with a Query DSL body · Explain a document match result
#
Ask an LLM
“Why doesn't a certain document match the Query DSL I POST?”
“Can I post a full query body to get a scoring explanation for one doc?”
Tell an agent
POST query {query} to explain the match for document {id} in {index}.
Tell me how {index} doc {id} scores against this DSL body {query}.
Ask an LLM
“Which fields are searchable and aggregatable across the entire cluster?”
“Can I check a field's type in every index with a simple GET?”
Tell an agent
Get field capabilities for {fields} across all indices.
Show cluster-wide capabilities of fields {fields}, including unmapped ones, via GET.
Ask an LLM
“Can I POST an index filter to narrow field capabilities cluster-wide?”
“How do I include runtime mappings when checking field capabilities in every index?”
Tell an agent
POST a field caps request for {fields} over all indices filtered by {index_filter}.
Check capabilities of body fields {fields} everywhere, adding runtime mappings {runtime_mappings}.
Ask an LLM
“What types do fields have in one particular index?”
“Can I see whether a field is aggregatable in a single data stream using GET?”
Tell an agent
Get field capabilities for {fields} in index {index}.
Via GET, list which fields in {index} are searchable and aggregatable.
Ask an LLM
“Can I POST an index filter when checking field types in one index?”
“How do I check field capabilities for a single index with a request body?”
Tell an agent
POST a field caps request for body fields {fields} on {index}.
Check {index} field capabilities with index filter {index_filter} in the body.
Ask an LLM
“How do I send multiple searches in a single NDJSON request?”
“Can I cap how many searches run concurrently in a multi-search GET?”
Tell an agent
Run a multi-search GET across all indices.
Execute these batched searches with GET, at most {max_concurrent_searches} at a time.
Ask an LLM
“Can I POST header and body pairs to run many searches at once?”
“What format does the multi-search POST body use?”
Tell an agent
POST a multi-search NDJSON body over the whole cluster.
Send a batch of searches by POST, defaulting to indices {index}.
Ask an LLM
“Can I run multiple searches that default to one index with a GET?”
“How do I batch searches scoped to a specific data stream using GET?”
Tell an agent
Run a multi-search GET against index {index}.
Using GET, execute my batched queries on {index} with {max_concurrent_searches} running concurrently.
Ask an LLM
“Can I POST an NDJSON batch of searches that target one index by default?”
“How do I run many queries against a single index in one POST?”
Tell an agent
POST a multi-search body to index {index}.
Batch-run searches on {index} via POST and return typed aggregation keys.
Ask an LLM
“How do I run multiple stored search templates in one GET request?”
“Can I batch templated searches cluster-wide with a GET?”
Tell an agent
Run a multi search template GET over all indices.
Execute several templated searches by GET with search type {search_type}.
Ask an LLM
“Can I POST a newline-delimited file of template searches with curl?”
“Why should I use --data-binary when posting multiple templated searches?”
Tell an agent
POST a multi search template NDJSON body across the cluster.
Send my batch of templated queries by POST, limited to {max_concurrent_searches} concurrent.
GET
/{index}/_msearch/template
Run several templated searches on an index (GET) · Run multiple templated searches
#
Ask an LLM
“Can I run multiple search templates that default to one index using GET?”
“How do I batch template-based searches on a single data stream with a GET?”
Tell an agent
Run a multi search template GET on index {index}.
Using GET, execute several stored templates against {index}.
POST
/{index}/_msearch/template
Run several templated searches on an index (POST) · Run multiple templated searches
#
Ask an LLM
“Can I POST a batch of template searches scoped to one index?”
“How do I send multiple templated queries for a single index in one POST?”
Tell an agent
POST an NDJSON list of stored template calls against {index}.
Batch my templated searches on {index} by POST with search type {search_type}.
Ask an LLM
“How do I get a consistent snapshot of an index to paginate with search_after?”
“How long does a point in time stay open?”
Tell an agent
Open a point in time on {index} kept alive for {keep_alive}.
Create a PIT over {index} for {keep_alive}, filtered by {index_filter}.
Ask an LLM
“How do I measure the quality of my search rankings against typical queries?”
“Can I score ranking relevance cluster-wide with a GET request?”
Tell an agent
Evaluate ranking quality for rated requests {requests} across all indices.
Using GET, score these rated queries {requests} with metric {metric}.
Ask an LLM
“Can I POST rated search requests and a metric like precision to evaluate ranking?”
“Which relevance metric does ranking evaluation compute by POST?”
Tell an agent
POST a rank evaluation of {requests} over the whole cluster.
Compute {metric} for my rated queries {requests} by POST.
GET
/{index}/_rank_eval
Evaluate ranking quality on an index (GET) · Evaluate ranked search results
#
Ask an LLM
“How well does one index rank results for my set of test queries?”
“Can I evaluate relevance for a single index using GET?”
Tell an agent
Evaluate ranking of {requests} on index {index}.
Using GET, measure {metric} for rated queries {requests} against {index}.
POST
/{index}/_rank_eval
Evaluate ranking quality on an index (POST) · Evaluate ranked search results
#
Ask an LLM
“Can I POST rated requests to judge search quality for one index?”
“How do I benchmark a single data stream's relevance with a POST?”
Tell an agent
POST a rank eval of {requests} to index {index}.
Benchmark relevance of {index} by POST using metric {metric} and rated queries {requests}.
Ask an LLM
“How do I preview the query a search template produces for given params?”
“Can I render an inline template source with a GET request?”
Tell an agent
Render template source {source} with params {params}.
Using GET, show the search body that stored template {id} expands to.
Ask an LLM
“Can I POST a Mustache template and params to see the resulting request body?”
“What does a rendered search template look like before it runs?”
Tell an agent
POST template {source} with {params} and return the rendered query.
Expand the stored template named {id} in the body by POST, filling {params}.
Ask an LLM
“How do I render a stored template by putting its ID in the URL with GET?”
“Can I check what a saved search template outputs for certain params?”
Tell an agent
Render stored template {id} with params {params}.
Via GET, preview the query produced by saved template {id}.
POST
/_render/template/{id}
Render a stored search template by ID (POST) · Render a search template
#
Ask an LLM
“Can I POST params to a stored template's URL to render it?”
“Is there a POST form of rendering a template that takes the ID in the path?”
Tell an agent
POST params {params} to render saved template {id}.
Show the expanded search request for path template {id} using POST.
Ask an LLM
“How do I search every index in the cluster with a simple query string?”
“If I send both q and a body query, which one is used?”
Tell an agent
Search all indices for {q}.
Run a cluster-wide GET search for {q} returning {size} hits sorted by {sort}.
Ask an LLM
“Can I POST Query DSL with aggregations to search the whole cluster?”
“Does the search API support kNN vector search in a POST body?”
Tell an agent
POST search query {query} across every index.
Run a cluster-wide body search with aggregations {aggregations} and size {size}.
Ask an LLM
“How do I search a single index or data stream for a keyword?”
“Can I page through one index's hits with from and size on a GET?”
Tell an agent
Search index {index} for {q}.
Using GET, return hits {from} to {from}+{size} from {index}.
Ask an LLM
“Can I POST a Query DSL body with highlighting to search one index?”
“How do I run aggregations over a single data stream in a POST search?”
Tell an agent
POST query {query} to search {index}.
Aggregate {index} with {aggregations} in a body search.
GET
/{index}/_mvt/{field}/{zoom}/{x}/{y}
Get a geo vector tile with a GET request · Search a vector tile
#
Ask an LLM
“How do I get a Mapbox vector tile of geo points for a map tile with GET?”
“Can I fetch geospatial hits as a binary vector tile by zoom, x and y?”
Tell an agent
Get vector tile {zoom}/{x}/{y} of field {field} in {index}.
Using GET, build a {grid_agg} grid tile at {zoom}/{x}/{y} for {field} from index {index}.
POST
/{index}/_mvt/{field}/{zoom}/{x}/{y}
Get a geo vector tile with a POST body · Search a vector tile
#
Ask an LLM
“Can I POST a query and aggregations to filter what goes into a vector tile?”
“What request body options does the vector tile POST search accept?”
Tell an agent
POST query {query} for tile {zoom}/{x}/{y} on {field} in {index}.
Render map tile {zoom}/{x}/{y} of geo field {field} in {index} with body aggs {aggs}.
Ask an LLM
“Which indices and shards would a search against the whole cluster run on?”
“Can I troubleshoot routing and shard preferences with a GET?”
Tell an agent
Show the search shards across all indices.
Using GET, list shards a search with routing {routing} would target.
Ask an LLM
“Is there a POST form for listing the shards a cluster-wide search would use?”
“Can I check shard targets for a given preference value by POST?”
Tell an agent
POST a search shards request for every index.
Tell me by POST which shards preference {preference} would pick cluster-wide.
GET
/{index}/_search_shards
See which shards a search on an index would hit (GET) · Get the search shards
#
Ask an LLM
“Which shards of one index would a search request run against?”
“Can I see filtered alias details for a single index's search shards via GET?”
Tell an agent
Show the search shards for index {index}.
Using GET, list the shards in {index} that routing value {routing} targets.
POST
/{index}/_search_shards
See which shards a search on an index would hit (POST) · Get the search shards
#
Ask an LLM
“Can I POST to find the shards a search on one data stream would touch?”
“How do I check shard selection for an index with a POST?”
Tell an agent
POST a search shards request for {index}.
Report by POST the shards of {index} chosen under preference {preference}.
GET
/_search/template
Run a templated search across all indices (GET) · Run a search with a search template
#
Ask an LLM
“How do I run a stored search template with parameters across the cluster?”
“Can I execute a search template through a GET request?”
Tell an agent
Run search template {id} with params {params} across all indices.
Using GET, execute inline template {source} cluster-wide.
POST
/_search/template
Run a templated search across all indices (POST) · Run a search with a search template
#
Ask an LLM
“Can I POST a template ID and params to search every index?”
“Can I profile a templated search when posting it?”
Tell an agent
POST template {id} with {params} to search the whole cluster.
Execute my inline Mustache template {source} by POST over all indices.
GET
/{index}/_search/template
Run a templated search on an index (GET) · Run a search with a search template
#
Ask an LLM
“How do I run a search template against one specific index?”
“Can I execute a parameterized template on a data stream with GET?”
Tell an agent
Run search template {id} on index {index} with params {params}.
Using GET, apply inline template {source} to {index}.
POST
/{index}/_search/template
Run a templated search on an index (POST) · Run a search with a search template
#
Ask an LLM
“Can I POST a stored template and params to search a single index?”
“How do I explain scores for a templated search on one index by POST?”
Tell an agent
POST template {id} with {params} to search {index}.
Search {index} by POST using Mustache source {source}.
Ask an LLM
“How do I build fast autocomplete from the terms stored in a field?”
“Can the terms lookup return terms from deleted documents?”
Tell an agent
List terms in field {field} of {index} starting with {string}.
Using GET, suggest up to {size} values from {field} in {index}.
Ask an LLM
“Can I POST a partial string to get matching field terms, ignoring case?”
“Is there a POST form of the terms enum lookup with an index filter?”
Tell an agent
POST prefix {string} to enumerate {field} terms in index {index} case-insensitively.
Autocomplete {field} in {index} by POST, filtered by {index_filter}.