Match phrase prefix is one of the key search queries in our applications but we are often getting inconsistent results with it. So far, we’ve observed that, quite often, the configured/default limit of max_expansions for the last term(prefix) happens to be too low for number of tokens present for the textual field, yielding the incorrect search results. I have the following questions:
- Does Opensearch community recommend increasing max_expansions parameter value to a very high number so that we hopefully include all possible sets of results in the expansion? What are the downsides of it?
- Instead of increasing the max_expansions, does analyzing the textual field so as to create longer tokens, subsequently creating lesser tokens, help? What kinds of other alternatives we can adopt in token filters?
- What are the best practices in match phrase query usages?
- Which other alternative better overcomes the issues of ‘match phrase prefix’ queries - ‘completion suggester’ or ‘search_as_you_type’ field and why?