版本: 7.1-7.15
简而言之,当传入数据中字段的数据类型与Elasticsearch中定义的映射不匹配时,会出现此错误。数据中的’name’字段的类型与Elasticsearch中定义的类型不同。要解决此问题,您可以更改数据中字段的数据类型以匹配Elasticsearch映射,或者更新Elasticsearch映射以匹配数据中字段的数据类型。此外,确保数据类型与您打算对该字段执行的操作兼容。
日志上下文 #
日志"[" + name + “] field which is of type [” class name is MappedFieldType.java. 我们从Elasticsearch源代码中提取了以下内容,以供深入理解:
public abstract Query termQuery(Object value, @Nullable SearchExecutionContext context); // Case insensitive form of term query (not supported by all fields so must be overridden to enable)
public Query termQueryCaseInsensitive(Object value, @Nullable SearchExecutionContext context) {
throw new QueryShardException(context, "[" + name + "] field which is of type [" + typeName() +
"]; does not support case insensitive term queries");
} /** Build a constant-scoring query that matches all values. The default implementation uses a
* {@link ConstantScoreQuery} around a {@link BooleanQuery} whose {@link Occur#SHOULD} clauses





