AuthThe Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats.AvailabilityGenerally available since 7.14This functionality is generally available and ready for production usage.Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments.This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Discover terms that match a partial string in an index.
This API is designed for low-latency look-ups used in auto-complete scenarios.
Note
The terms enum API may return terms from deleted documents. Deleted documents are initially only marked as deleted. It is not until their segments are merged that documents are actually deleted. Until that happens, the terms enum API will return terms from these documents.
A comma-separated list of data streams, indices, and index aliases to search.
Wildcard (*) expressions are supported.
To search all data streams or indices, omit this parameter or use * or _all.
The string to match at the start of indexed terms. If not provided, all terms in the field are considered.
sizenumber · default: 10
The number of matching terms to return.
timeoutuniononeOf · default: 1s
The maximum length of time to spend collecting results.
If the timeout is exceeded the complete flag set to false in the response and the results may be partial or empty.
Values:-10
case_insensitiveboolean · default: false
When true, the provided search string is matched against index terms without case sensitivity.
Filter an index shard if the provided query rewrites to match_none.
stringstring
The string to match at the start of indexed terms.
If it is not provided, all terms in the field are considered.
Note
The prefix string cannot be larger than the largest possible keyword value, which is Lucene's term byte-length limit of 32766.
search_afterstring
The string after which terms in the index should be returned.
It allows for a form of pagination if the last result from one request is passed as the search_after parameter for a subsequent request.
If false, the returned terms set may be incomplete and should be treated as approximate.
This can occur due to a few reasons, such as a request timeout or a node error.