[suggest]的映射定义具有不受支持的参数:[payloads:true]

时间:2017-04-20 08:20:58

标签: json curl elasticsearch

我正在使用ElasticSearch文档here使用Completion Suggestor的示例,但我收到一条错误消息,指出payloads: true是不受支持的参数。除非文档错误,否则显然支持哪个?我有最新的Elasticsearch应用程序安装(5.3.0)。

这是我的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
        }
    }
  }
}';

错误:

{
  "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
}

1 个答案:

答案 0 :(得分:3)

通过以下提交已在ElasticSearch 5.3.0中删除了payload参数:Remove payload option from completion suggester 。这是comit消息:

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.