I want to build completion suggester in ElasticSearch.
I have data look like this.
{
"suggest": {
"input": ["iphone", "iphone x"]
},
"category_id": 1
},
{
"suggest": {
"input": ["iphone", "iphone 8"]
},
"category_id": 2
},
{
"suggest": {
"input": ["iphone", "iphone 7"]
},
"category_id": 1
}
And when I search with "iphone" keyword I want it checks duplicated keywords with different category_id.
This is result that I want to see.
{
"suggest": iphone
"category": 1
},
{
"suggest": iphone
"category": 2
}
If I use skip_duplicates feature, it will returns me only one record because "iphone" are duplicated.
Thanks for your helps.