gpt4 book ai didi

elasticsearch - Elasticsearch索引映射更新

转载 作者:行者123 更新时间:2023-12-03 00:59:06 25 4
gpt4 key购买 nike

我正在使用ES-2.4.0
索引json:
{
"_id": 1,
"name": "Longsword",
"description": "The Longsword can be wielded in one or two hands",
"category": "Sharp"
}

1.我创建了一个索引,并且正在创建默认映射。
2.现在,我正在尝试按照此处的建议更新映射。

连结:https://gist.github.com/nicolashery/6317643

关于点1:我没有使用过任何分析仪;
关于点2:我正在使用分析器“not_analysed”;

但这是行不通的。

问题:如果没有,ES-2.X是否停止了映射更新工具,我该如何更新映射?

注意:尝试时出现此错误

{ "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "Mapper for [name] conflicts with existing mapping in other types:\n[mapper [name] has different [analyzer]]" } ], "type": "illegal_argument_exception", "reason": "Mapper for [name] conflicts with existing mapping in other types:\n[mapper [name] has different [analyzer]]" }, "status": 400 }

最佳答案

否,从 ES 2.x 开始,不允许更改现有字段的映射类型。

documentation

In general, the mapping for existing fields cannot be updated. There are some exceptions to this rule. For instance:

  • new properties can be added to Object datatype fields.
  • new multi-fields can be added to existing fields.
  • doc_values can be disabled, but not enabled.
  • the ignore_above parameter can be updated.


您必须首先 delete the index并使用新映射创建一个新的。还有一个小错字,是 not_analyzed (“z”不是“s”)

关于elasticsearch - Elasticsearch索引映射更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40305880/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com