Get tokens from text analysis
- POST also GET /{index}/_analyze
- POST also GET /_analyze
The analyze API performs analysis on a text string and returns the resulting tokens.
Generating excessive amount of tokens may cause a node to run out of memory.
The index.analyze.max_token_count setting enables you to limit the number of tokens that can be produced.
If more than this limit of tokens gets generated, an error occurs.
The _analyze endpoint without a specified index will always use 10000 as its limit.
Required authorization
- Index privileges index
Request body
-
analyzerstring -
The name of the analyzer that should be applied to the provided
text. This could be a built-in analyzer, or an analyzer that’s been configured in the index. -
explainboolean · default: false -
If
true, the response includes token attributes and additional details. -
fieldstring -
Field used to derive the analyzer. To use this parameter, you must specify an index. If specified, the
analyzerparameter overrides this value.