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.
Index used to derive the analyzer.
If specified, the analyzer or field parameter overrides this value.
If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer.
Index used to derive the analyzer.
If specified, the analyzer or field parameter overrides this value.
If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer.
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.
attributesstring[]
Array of token attributes used to filter the output of the explain parameter.
char_filteruniononeOf[]
Array of character filters used to preprocess characters before the tokenizer.
One of:
One of:
type: html_strip
typeenumrequired
Values:html_strip
versionstring
escaped_tagsstring[]
type: mapping
typeenumrequired
Values:mapping
versionstring
mappingsstring[]
mappings_pathstring
type: pattern_replace
typeenumrequired
Values:pattern_replace
versionstring
flagsstring
patternstringrequired
replacementstring
type: icu_normalizer
typeenumrequired
Values:icu_normalizer
versionstring
modeenum
Values:decomposecompose
nameenum
Values:nfcnfkcnfkc_cf
unicode_set_filterstring
type: kuromoji_iteration_mark
typeenumrequired
Values:kuromoji_iteration_mark
versionstring
normalize_kanabooleanrequired
normalize_kanjibooleanrequired
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 analyzer parameter overrides this value.
filteruniononeOf[]
Array of token filters used to apply after the tokenizer.
One of:
One of:
type: apostrophe
typeenumrequired
Values:apostrophe
versionstring
type: arabic_stem
typeenumrequired
Values:arabic_stem
versionstring
type: arabic_normalization
typeenumrequired
Values:arabic_normalization
versionstring
type: asciifolding
typeenumrequired
Values:asciifolding
versionstring
preserve_originalboolean | string
If true, emit both original tokens and folded tokens. Defaults to false.
type: bengali_normalization
typeenumrequired
Values:bengali_normalization
versionstring
type: brazilian_stem
typeenumrequired
Values:brazilian_stem
versionstring
type: cjk_bigram
typeenumrequired
Values:cjk_bigram
versionstring
ignored_scriptsenum[]
Array of character scripts for which to disable bigrams.
Values:hanhangulhiraganakatakana
output_unigramsboolean
If true, emit tokens in both bigram and unigram form. If false, a CJK character is output in unigram form when it has no adjacent characters. Defaults to false.
type: cjk_width
typeenumrequired
Values:cjk_width
versionstring
type: classic
typeenumrequired
Values:classic
versionstring
type: common_grams
typeenumrequired
Values:common_grams
versionstring
common_wordsstring[]
A list of tokens. The filter generates bigrams for these tokens.
Either this or the common_words_path parameter is required.
common_words_pathstring
Path to a file containing a list of tokens. The filter generates bigrams for these tokens.
This path must be absolute or relative to the config location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this or the common_words parameter is required.
ignore_caseboolean
If true, matches for common words matching are case-insensitive. Defaults to false.
query_modeboolean
If true, the filter excludes the following tokens from the output:
Unigrams for common words
Unigrams for terms followed by common words
Defaults to false. We recommend enabling this parameter for search analyzers.
type: condition
typeenumrequired
Values:condition
versionstring
filterstring[]required
Array of token filters. If a token matches the predicate script in the script parameter, these filters are applied to the token in the order provided.
scriptstringrequired
Predicate script used to apply token filters. If a token matches this script, the filters in the filter parameter are applied to the token.
type: czech_stem
typeenumrequired
Values:czech_stem
versionstring
type: decimal_digit
typeenumrequired
Values:decimal_digit
versionstring
type: delimited_payload
typeenumrequired
Values:delimited_payload
versionstring
delimiterstring
Character used to separate tokens from payloads. Defaults to |.
encodingenum
Data type for the stored payload.
Values:intfloatidentity
type: dutch_stem
typeenumrequired
Values:dutch_stem
versionstring
type: edge_ngram
typeenumrequired
Values:edge_ngram
versionstring
max_gramnumber
Maximum character length of a gram. For custom token filters, defaults to 2. For the built-in edge_ngram filter, defaults to 1.
min_gramnumber
Minimum character length of a gram. Defaults to 1.
sideenum
Indicates whether to truncate tokens from the front or back. Defaults to front.
Values:frontback
preserve_originalboolean | string
Emits original token when set to true. Defaults to false.
type: elision
typeenumrequired
Values:elision
versionstring
articlesstring[]
List of elisions to remove.
To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.
For custom elision filters, either this parameter or articles_path must be specified.
articles_pathstring
Path to a file that contains a list of elisions to remove.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break.
To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.
For custom elision filters, either this parameter or articles must be specified.
articles_caseboolean | string
If true, elision matching is case insensitive. If false, elision matching is case sensitive. Defaults to false.
type: fingerprint
typeenumrequired
Values:fingerprint
versionstring
max_output_sizenumber
Maximum character length, including whitespace, of the output token. Defaults to 255. Concatenated tokens longer than this will result in no token output.
separatorstring
Character to use to concatenate the token stream input. Defaults to a space.
type: flatten_graph
typeenumrequired
Values:flatten_graph
versionstring
type: french_stem
typeenumrequired
Values:french_stem
versionstring
type: german_normalization
typeenumrequired
Values:german_normalization
versionstring
type: german_stem
typeenumrequired
Values:german_stem
versionstring
type: hindi_normalization
typeenumrequired
Values:hindi_normalization
versionstring
type: hunspell
typeenumrequired
Values:hunspell
versionstring
dedupboolean
If true, duplicate tokens are removed from the filter’s output. Defaults to true.
dictionarystring
One or more .dic files (e.g, en_US.dic, my_custom.dic) to use for the Hunspell dictionary.
By default, the hunspell filter uses all .dic files in the <$ES_PATH_CONF>/hunspell/<locale> directory specified using the lang, language, or locale parameter.
localestringrequired
Locale directory used to specify the .aff and .dic files for a Hunspell dictionary.
longest_onlyboolean
If true, only the longest stemmed version of each token is included in the output. If false, all stemmed versions of the token are included. Defaults to false.
type: hyphenation_decompounder
typeenumrequired
Values:hyphenation_decompounder
versionstring
max_subword_sizenumber
Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to 15.
min_subword_sizenumber
Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to 2.
min_word_sizenumber
Minimum word character length. Shorter word tokens are excluded from the output. Defaults to 5.
only_longest_matchboolean
If true, only include the longest matching subword. Defaults to false.
word_liststring[]
A list of subwords to look for in the token stream. If found, the subword is included in the token output.
Either this parameter or word_list_path must be specified.
word_list_pathstring
Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this parameter or word_list must be specified.
hyphenation_patterns_pathstringrequired
Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file.
This path must be absolute or relative to the config location. Only FOP v1.2 compatible files are supported.
no_sub_matchesboolean
If true, do not match sub tokens in tokens that are in the word list. Defaults to false.
no_overlapping_matchesboolean
If true, do not allow overlapping tokens. Defaults to false.
type: indic_normalization
typeenumrequired
Values:indic_normalization
versionstring
type: keep_types
typeenumrequired
Values:keep_types
versionstring
modeenum
Indicates whether to keep or remove the specified token types.
Values:includeexclude
typesstring[]required
List of token types to keep or remove.
type: keep
typeenumrequired
Values:keep
versionstring
keep_wordsstring[]
List of words to keep. Only tokens that match words in this list are included in the output.
Either this parameter or keep_words_path must be specified.
keep_words_caseboolean
If true, lowercase all keep words. Defaults to false.
keep_words_pathstring
Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.
Either this parameter or keep_words must be specified.
type: keyword_marker
typeenumrequired
Values:keyword_marker
versionstring
ignore_caseboolean
If true, matching for the keywords and keywords_path parameters ignores letter case. Defaults to false.
keywordsunionstring | string[]
Array of keywords. Tokens that match these keywords are not stemmed.
This parameter, keywords_path, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern.
keywords_pathstring
Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.
This parameter, keywords, or keywords_pattern must be specified. You cannot specify this parameter and keywords_pattern.
keywords_patternstring
Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed.
This parameter, keywords, or keywords_path must be specified. You cannot specify this parameter and keywords or keywords_pattern.
type: keyword_repeat
typeenumrequired
Values:keyword_repeat
versionstring
type: kstem
typeenumrequired
Values:kstem
versionstring
type: length
typeenumrequired
Values:length
versionstring
maxnumber
Maximum character length of a token. Longer tokens are excluded from the output. Defaults to Integer.MAX_VALUE, which is 2^31-1 or 2147483647.
minnumber
Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to 0.
type: limit
typeenumrequired
Values:limit
versionstring
consume_all_tokensboolean
If true, the limit filter exhausts the token stream, even if the max_token_count has already been reached. Defaults to false.
max_token_countnumber | string
Maximum number of tokens to keep. Once this limit is reached, any remaining tokens are excluded from the output. Defaults to 1.
type: lowercase
typeenumrequired
Values:lowercase
versionstring
languageenum
Language-specific lowercase token filter to use.
Values:greekirishturkish
type: min_hash
typeenumrequired
Values:min_hash
versionstring
bucket_countnumber
Number of buckets to which hashes are assigned. Defaults to 512.
hash_countnumber
Number of ways to hash each token in the stream. Defaults to 1.
hash_set_sizenumber
Number of hashes to keep from each bucket. Defaults to 1.
Hashes are retained by ascending size, starting with the bucket’s smallest hash first.
with_rotationboolean
If true, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the hash_set_size is 1. If the bucket_count argument is greater than 1, this parameter defaults to true. Otherwise, this parameter defaults to false.
type: multiplexer
typeenumrequired
Values:multiplexer
versionstring
filtersstring[]required
A list of token filters to apply to incoming tokens.
preserve_originalboolean | string
If true (the default) then emit the original token in addition to the filtered tokens.
type: ngram
typeenumrequired
Values:ngram
versionstring
max_gramnumber
Maximum length of characters in a gram. Defaults to 2.
min_gramnumber
Minimum length of characters in a gram. Defaults to 1.
preserve_originalboolean | string
Emits original token when set to true. Defaults to false.
type: nori_part_of_speech
typeenumrequired
Values:nori_part_of_speech
versionstring
stoptagsstring[]
An array of part-of-speech tags that should be removed.
type: pattern_capture
typeenumrequired
Values:pattern_capture
versionstring
patternsstring[]required
A list of regular expressions to match.
preserve_originalboolean | string
If set to true (the default) it will emit the original token.
type: pattern_replace
typeenumrequired
Values:pattern_replace
versionstring
allboolean
If true, all substrings matching the pattern parameter’s regular expression are replaced. If false, the filter replaces only the first matching substring in each token. Defaults to true.
flagsstring
patternstringrequired
Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the replacement parameter.
replacementstring
Replacement substring. Defaults to an empty substring ("").
type: persian_normalization
typeenumrequired
Values:persian_normalization
versionstring
type: persian_stem
typeenumrequired
Values:persian_stem
versionstring
type: porter_stem
typeenumrequired
Values:porter_stem
versionstring
type: predicate_token_filter
typeenumrequired
Values:predicate_token_filter
versionstring
scriptstringrequired
Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output.
type: remove_duplicates
typeenumrequired
Values:remove_duplicates
versionstring
type: reverse
typeenumrequired
Values:reverse
versionstring
type: russian_stem
typeenumrequired
Values:russian_stem
versionstring
type: scandinavian_folding
typeenumrequired
Values:scandinavian_folding
versionstring
type: scandinavian_normalization
typeenumrequired
Values:scandinavian_normalization
versionstring
type: serbian_normalization
typeenumrequired
Values:serbian_normalization
versionstring
type: shingle
typeenumrequired
Values:shingle
versionstring
filler_tokenstring
String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (_).
max_shingle_sizenumber | string
Maximum number of tokens to concatenate when creating shingles. Defaults to 2.
min_shingle_sizenumber | string
Minimum number of tokens to concatenate when creating shingles. Defaults to 2.
output_unigramsboolean
If true, the output includes the original input tokens. If false, the output only includes shingles; the original input tokens are removed. Defaults to true.
output_unigrams_if_no_shinglesboolean
If true, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to false.
token_separatorstring
Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (" ").
Path to a file that contains a list of stop words to remove.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break.
type: synonym_graph
typeenumrequired
Values:synonym_graph
versionstring
expandboolean
Expands definitions for equivalent synonym rules. Defaults to true.
formatenum
Sets the synonym rules format.
Values:solrwordnet
lenientboolean
If true ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the updateable setting.
synonymsstring[]
Used to define inline synonyms.
synonyms_pathstring
Used to provide a synonym file. This path must be absolute or relative to the config location.
synonyms_setunionstring | string[]
Provide one or more synonym sets created through the Synonyms Management APIs. Maximum 100 sets per filter.
tokenizerstringdeprecated
Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.
updateableboolean
If true allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to false.
type: synonym
typeenumrequired
Values:synonym
versionstring
expandboolean
Expands definitions for equivalent synonym rules. Defaults to true.
formatenum
Sets the synonym rules format.
Values:solrwordnet
lenientboolean
If true ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the updateable setting.
synonymsstring[]
Used to define inline synonyms.
synonyms_pathstring
Used to provide a synonym file. This path must be absolute or relative to the config location.
synonyms_setunionstring | string[]
Provide one or more synonym sets created through the Synonyms Management APIs. Maximum 100 sets per filter.
tokenizerstringdeprecated
Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.
updateableboolean
If true allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to false.
type: trim
typeenumrequired
Values:trim
versionstring
type: truncate
typeenumrequired
Values:truncate
versionstring
lengthnumber
Character limit for each token. Tokens exceeding this limit are truncated. Defaults to 10.
type: unique
typeenumrequired
Values:unique
versionstring
only_on_same_positionboolean
If true, only remove duplicate tokens in the same position. Defaults to false.
type: uppercase
typeenumrequired
Values:uppercase
versionstring
type: word_delimiter_graph
typeenumrequired
Values:word_delimiter_graph
versionstring
catenate_allboolean
If true, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to false.
catenate_numbersboolean
If true, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to false.
catenate_wordsboolean
If true, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to false.
generate_number_partsboolean
If true, the filter includes tokens consisting of only numeric characters in the output. If false, the filter excludes these tokens from the output. Defaults to true.
generate_word_partsboolean
If true, the filter includes tokens consisting of only alphabetical characters in the output. If false, the filter excludes these tokens from the output. Defaults to true.
preserve_originalboolean | string
If true, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to false.
protected_wordsstring[]
Array of tokens the filter won’t split.
protected_words_pathstring
Path to a file that contains a list of tokens the filter won’t split.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
split_on_case_changeboolean
If true, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to true.
split_on_numericsboolean
If true, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to true.
stem_english_possessiveboolean
If true, the filter removes the English possessive ('s) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to true.
type_tablestring[]
Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
type_table_pathstring
Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
adjust_offsetsboolean
If true, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to true.
ignore_keywordsboolean
If true, the filter skips tokens with a keyword attribute of true. Defaults to false.
type: word_delimiter
typeenumrequired
Values:word_delimiter
versionstring
catenate_allboolean
If true, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to false.
catenate_numbersboolean
If true, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to false.
catenate_wordsboolean
If true, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to false.
generate_number_partsboolean
If true, the filter includes tokens consisting of only numeric characters in the output. If false, the filter excludes these tokens from the output. Defaults to true.
generate_word_partsboolean
If true, the filter includes tokens consisting of only alphabetical characters in the output. If false, the filter excludes these tokens from the output. Defaults to true.
preserve_originalboolean | string
If true, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to false.
protected_wordsstring[]
Array of tokens the filter won’t split.
protected_words_pathstring
Path to a file that contains a list of tokens the filter won’t split.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
split_on_case_changeboolean
If true, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to true.
split_on_numericsboolean
If true, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to true.
stem_english_possessiveboolean
If true, the filter removes the English possessive ('s) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to true.
type_tablestring[]
Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
type_table_pathstring
Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to 15.
min_subword_sizenumber
Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to 2.
min_word_sizenumber
Minimum word character length. Shorter word tokens are excluded from the output. Defaults to 5.
only_longest_matchboolean
If true, only include the longest matching subword. Defaults to false.
word_liststring[]
A list of subwords to look for in the token stream. If found, the subword is included in the token output.
Either this parameter or word_list_path must be specified.
word_list_pathstring
Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this parameter or word_list must be specified.
normalizerstring
Normalizer to use to convert text into a single token.
textuniononeOf
Text to analyze.
If an array of strings is provided, it is analyzed as a multi-value field.