本文介绍了Elasticsearch 7:根映射定义具有不受支持的参数(mapper_parsing_exception)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在Elasticsearch 7中插入以下映射
When trying to insert the following mapping in Elasticsearch 7
PUT my_index/items/_mapping { "settings":{ }, "mappings":{ "items":{ "properties":{ "products":{ "properties":{ "classification":{ "type":"text", "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } }, "original_text":{ "type":"text", "store":false, "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } } } }, "title":{ "type":"text", "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } }, "analyzer":"autocomplete" }, "image":{ "properties":{ "type":{ "type":"text", "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } }, "location":{ "type":"text", "store":false, "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } } } } } } } }我收到以下形式的错误:
I get an error of the form:
{ "error": { "root_cause": [ { "type": "mapper_parsing_exception", "reason": "Root mapping definition has unsupported parameters:导致此错误的原因是什么?
What is causing this error?
推荐答案在Elasticsearch 7中,不赞成使用映射类型,这会导致中断从根本上改变这个问题。
In Elasticsearch 7, mapping types have been deprecated, which is causing the breaking change at the source of this problem.
公告,由Elasticsearch小组针对弃用,路线图和替代方法进行。
Announcement by the Elasticsearch team of the deprecation, roadmap, and alternatives.
要解决此问题,只需删除所有对映射类型的引用(项目)。
To fix this, simply remove all references to mapping types ("items" in this example):
PUT my_index/_mapping { "settings":{ }, "mappings":{ "properties":{ "products":{ "properties":{ "classification":{ "type":"text", "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } }, "original_text":{ "type":"text", "store":false, "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } } } }, "title":{ "type":"text", "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } }, "analyzer":"autocomplete" }, "image":{ "properties":{ "type":{ "type":"text", "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } }, "location":{ "type":"text", "store":false, "fields":{ "raw":{ "type":"keyword", "ignore_above":256 } } } } } } } }更多推荐
Elasticsearch 7:根映射定义具有不受支持的参数(mapper
发布评论