2
votes

My elasticsearch current version is 6.0.1.

I'm using a completion suggester on my "suggest" field as follow:

GET my_index/_search
{
    "suggest": {
            "tag-suggest" : {
                "prefix" : "black",
                "completion" : {
                "field" : "suggest",
                "size" : 10,
                "fuzzy" : {
                    "fuzziness" : 1
                }
            }
        }
    }
}

I'd like to skip duplicates in order to only retrieve unique suggestions.

According to elasticsearch documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters-completion.html) I can achieve that by turning the option "skip_duplicates" to true:

GET my_index/_search
{
    "suggest": {
            "tag-suggest" : {
                "prefix" : "black",
                "completion" : {
                "field" : "suggest",
                "skip_duplicates": true,
                "size" : 10,
                "fuzzy" : {
                    "fuzziness" : 1
                }
            }
        }
    }
}

Unfortunately I'm getting the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "[completion] unknown field [skip_duplicates], parser not found"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "[completion] unknown field [skip_duplicates], parser not found"
  },
  "status": 400
} 
1

1 Answers