版本: 7.7-7.9
简而言之,当你尝试更改 Elasticsearch 中现有字段的数据类型时,会出现此错误。value] cannot be changed from [keyword] to [text]。Elasticsearch 不允许在字段创建后更改其数据类型。要解决此问题,你可以创建一个具有正确映射的新索引,或者将数据重新索引到具有正确映射的新索引中。或者,你可以向现有索引添加一个具有不同名称和所需数据类型的新字段。
日志上下文 #
日志 “Property [value] of field [” 的类名是 ConstantKeywordFieldMapper.java。我们从 Elasticsearch 源代码中提取以下内容,为那些寻求深入上下文的人提供:
value = node.remove("value");
if (value == null) {
throw new MapperParsingException("Property [value] of field [" + name + "] can't be [null].");
}
if (value instanceof Number == false && value instanceof CharSequence == false) {
throw new MapperParsingException("Property [value] of field [" + name +
"] must be a number or a string; but got [" + value + "]");
}
}
ConstantKeywordFieldMapper.Builder builder = new ConstantKeywordFieldMapper.Builder(name);
if (value != null) {





