Elasticsearch 7:根映射定义具有不受支持的参数(mapper

编程入门 行业动态 更新时间:2024-10-23 16:15:43
本文介绍了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

本文发布于:2023-10-29 08:01:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539155.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不受   定义   参数   Elasticsearch   mapper

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!