l3fty
l3fty

Reputation: 584

Mapping definition for [suggest] has unsupported parameters: [payloads : true]

I am using an example right from ElasticSearch documentation here using the Completion Suggestor but I am getting an error saying payloads: true is an unsupported parameter. Which obviously is supported unless the docs are wrong? I have the latest Elasticsearch app install (5.3.0).

Here is my cURL:

curl -X PUT localhost:9200/search/pages/_mapping -d '{
"pages" : {
    "properties": {
        "title": { 
            "type" : "string" 
        },
        "suggest" : { 
            "type" : "completion",
            "analyzer" : "simple",
            "search_analyzer" : "simple",
            "payloads" : true
        }
    }
  }
}';

And the error:

{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "Mapping definition for [suggest] has unsupported parameters:  [payloads : true]"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "Mapping definition for [suggest] has unsupported parameters:  [payloads : true]"
  },
  "status" : 400
}

Upvotes: 3

Views: 2031

Answers (1)

Ortomala Lokni
Ortomala Lokni

Reputation: 62635

The payloadparameter has been removed in ElasticSearch 5.3.0 by the following commit: Remove payload option from completion suggester . Here is the comit message:

The payload option was introduced with the new completion
suggester implementation in v5, as a stop gap solution
to return additional metadata with suggestions.

Now we can return associated documents with suggestions
(#19536) through fetch phase using stored field (_source).
The additional fetch phase ensures that we only fetch
the _source for the global top-N suggestions instead of
fetching _source of top results for each shard.

Upvotes: 4

Related Questions