版本: 8.3-8.9
简要来说,当 Elasticsearch 无法在指定字段上创建查询时,就会发生此错误。这可能是由于字段不存在、字段名称错误或数据类型不匹配造成的。要解决此问题,请确保字段存在于您的索引中,并且字段名称拼写正确。此外,还要检查字段的数据类型,确保它与查询相匹配。如果字段是经过分析的,请使用 keyword 来避免在查询期间进行分析。
日志上下文 #
日志 “Exception creating query on Field [” + fieldName + “]” 的类名是 GeoShapeQueryable.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解上下文的人参考:
default Query geoShapeQuery(SearchExecutionContext context, String fieldName, ShapeRelation relation, Geometry shape) {
final LatLonGeometry[] luceneGeometries;
try {
luceneGeometries = toQuantizeLuceneGeometry(shape, relation);
} catch (IllegalArgumentException e) {
throw new QueryShardException(context, "Exception creating query on Field [" + fieldName + "] " + e.getMessage(), e);
}
if (luceneGeometries.length == 0) {
return new MatchNoDocsQuery();
}
return geoShapeQuery(context, fieldName, relation, luceneGeometries);





