2017-04-20 31 views
0

我正在使用ElasticSearch文檔here使用Completion Suggestor的示例,但出現錯誤,說明payloads: true是不受支持的參數。除非文檔錯誤,哪些顯然是支持的?我有最新的Elasticsearch應用程序安裝(5.3.0)。[suggest]的映射定義具有不受支持的參數:[payloads:true]

這裏是我的捲毛:

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 
} 
+2

對於5.3的文檔是不同的:https://www.elastic.co/guide/en/elasticsearch/reference/5.3/search-suggesters-completion.html#completion-suggester映射,並且不再有「有效載荷」。 –

+0

@AndreiStefan哇,我現在不覺得愚蠢。閱讀這些新文檔,我沒有看到類似於有效載荷的任何內容。我需要爲建議添加額外的信息。有沒有辦法做到這一點?此外,如果你添加這個答案,我可以標記它是正確的,哈哈。 – l3fty

+0

那麼,別人已經做了搜索,並發現github問題有關「有效載荷」的刪除。 –

回答

1

的​​參數已經在ElasticSearch 5.3.0被刪除通過以下承諾: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. 
相關問題