Elasticsearch 5.6 shows duplicate suggest result

Hello Team,

I am using elasticsearch 5.6 cluster and when I try to perform suggest query it is giving duplicate results. As data in the field contain duplicate data but I need a unique suggest result.

Mapping -- >
{
"indexTest-21-12-17": {
"mappings": {
"policy": {
"properties": {
"SuggestAccountName": {
"type": "completion",
"analyzer": "simple",
"preserve_separators": true,
"preserve_position_increments": true,
"max_input_length": 1000
}
}
}
}
}
}

Query -->
{"SuggestAccountName":{"text":"TE","completion":{"field":"SuggestAccountName","size":5}}}

You might want to look into the skip_duplicates option which is available as of 6.1: https://www.elastic.co/guide/en/elasticsearch/reference/master/search-suggesters-completion.html#skip_duplicates.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.