first of all, I am using elasticsearch 6.3.The following is a description of the problem:
the official document says that there is a parameter max_expansions in the match_phrase_prefix query that says that the parameter max_expansions controls the number of words that can match the prefix, with a default value of 50.
take the I like swi
query as an example, which first looks for the first word that matches the prefix swi
, and then searches and collects the matching words in alphabetical order until there are no more matching words or when the number exceeds max_expansions.
but when I use it, I deliberately invent dozens of words that start with swi and set the value of max_expansions to 10. But it returns all the results. If you know why, please let me know. Thank you very much.
GET matchphaseprefixtest/_search
{
"query": {
"match_phrase_prefix": {
"message": {
"query": "I like sw",
"max_expansions": 10
}
}
}
}