I am using elasticsearch completion suggester thesedays, and got some problem that it always produce similar results.
Say I search with the following statement:
"my_suggestion": {
> "text": "ni",
> "completion": {
> "field": "my_name_for_sug"
> }
> }
And get the following results:
"my_suggestion" : [ {
"text" : "ni",
"offset" : 0,
"length" : 2,
"options" : [ {
"text" : "Nine West",
"score" : 329.0
}, {
"text" : "Nine West ",
"score" : 329.0
}, {
"text" : "Nike",
"score" : 295.0
}, {
"text" : "NINE WEST",
"score" : 168.0
}, {
"text" : "NINE WEST ",
"score" : 168.0
} ]
} ],
So the question is how can I merge or aggregate the same results like "NINE WEST" and "NINE WEST ".
the mapping is:
"my_name_for_sug": {
"type": "completion"
,"analyzer": "ik_max_word"
,"search_analyzer": "ik_max_word"
,"payloads": true
,"preserve_separators": false
}
where ik_max_word is an chinese-specific analyzer, and it can do the standard analyzer's job.
Thanks