为渗滤查询创建索引

编程入门 行业动态 更新时间:2024-10-28 16:26:22
本文介绍了为渗滤查询创建索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试在Elasticsearch中进行渗滤查询,但按照文档我遇到了一个错误.我运行了以下内容:

I'm trying percolate query in elasticsearch, but creating an index as explained in the docs I'm greeted with an error. I ran the following:

PUT /my_percolate_index { "mappings": { "doctype": { "properties": { "message": { "type": "text" } } }, "queries": { "properties": { "query": { "type": "percolator" } } } } }

我遇到以下错误:

{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]" } ], "type": "illegal_argument_exception", "reason": "Rejecting mapping update to [my_percolate_index] as the final mapping would have more than 1 type: [doctype, queries]" }, "status": 400 }

我在这里想念东西吗?

推荐答案

由于您使用的是ES 6 ,因此只需要在映射类型内移动query字段

Since you're using ES 6, you just need to move the query field inside your mapping type

PUT /my_percolate_index { "mappings": { "doctype": { "properties": { "message": { "type": "text" }, "query": { "type": "percolator" } } } } }

请注意,从ES 6开始,任何索引内都只允许使用一种映射类型.

Note that as of ES 6, only a single mapping type is allowed within any index.

更多推荐

为渗滤查询创建索引

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

发布评论

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

>www.elefans.com

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