When using the Completion Suggester, the results you get are regular documents. I get that
However, we'd like to receive search phrase suggestions instead of direct results (the documents). To achieve this we thought that we could store several corresponding "search phrases" to the documents, and provide this as the "suggest" field when indexing.
In general this works, however the Suggester returns now all documents which contains these matches search phrases, which causes duplicate phrases.
For instance when having 2 documents:
- Document A is a blue "BMW X3", which has "blue car" attached as "suggest" phrase.
- Document B is a blue "Volvo V60", which also has "blue car" attached as "suggest" phrase.
When searching for "blue", the Suggester now returns both documents, and in fact this is a duplicate result we don't want.
Is the above setup the way to go, and how could we filter out these duplicates? Or do we need a different approach?