If you realize some results are missing for phrase_prefix
search, it's because of the max_expansions
limitation.
While easy to set up, using the match_phrase_prefix query for search
autocompletion can sometimes produce confusing results.
For example, consider the query string quick brown f. This query works
by creating a phrase query out of quick and brown (i.e. the term quick
must exist and must be followed by the term brown). Then it looks at
the sorted term dictionary to find the first 50 terms that begin with
f, and adds these terms to the phrase query.
The problem is that the first 50 terms may not include the term fox so
the phrase quick brown fox will not be found. This usually isn’t a
problem as the user will continue to type more letters until the word
they are looking for appears.
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase-prefix.html#match-phrase-prefix-autocomplete
As a workaround you can use multiple prefix under a bool query.
GET items/_search
{"query":{"bool":{"should":[
{"prefix":{"name_en":{"value":"musab","case_insensitive":true}}},
{"prefix":{"name_tr":{"value":"musab","case_insensitive":true}}},
{"prefix":{"name_de":{"value":"musab","case_insensitive":true}}}
]}}}