版本: 6.8-7.9
简而言之,当尝试在 Elasticsearch 中修改现有字段的 [doc_values] 设置时,会发生此错误。Doc_values 用于排序、聚合和脚本中。一旦字段使用了特定的 doc_values 设置创建,就无法再更改。要解决此问题,您可以创建一个具有所需设置的新索引并重新索引数据。或者,您可以向现有索引添加一个具有正确设置的新字段,然后将数据迁移到新字段。
日志上下文 #
日志 “Setting [doc_values] cannot be modified for field [” + name + “]” 的类名是 Murmur3FieldMapper.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人使用:
throws MapperParsingException {
Builder builder = new Builder(name); // 调整这些设置不再允许;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 + "]");
}





