📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-7.9

简而言之,当尝试修改Elasticsearch中现有字段的’index’设置时会发生此错误。这是不允许的,因为Elasticsearch不支持在字段创建后更改其’index’设置。要解决此问题,您可以使用所需设置创建新索引并重新索引数据,或者在现有索引中添加具有正确’index’设置的新字段。记得根据需要更新查询和应用程序以使用新字段或索引。

日志上下文 #

日志"Setting [index] cannot be modified for field [" + name + “]“的类名是 Murmur3FieldMapper.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:

// 不再允许调整这些设置;murmur3字段的全部目的是存储哈希
 if (node.get("doc_values") != null) {
 throw new MapperParsingException("Setting [doc_values] cannot be modified for field [" + name + "]");
 }
 if (node.get("index") != null) {
 throw new MapperParsingException("Setting [index] cannot be modified for field [" + name + "]");
 }  TypeParsers.parseField(builder; name; node; parserContext);  return builder;