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

版本: 6.8-7.3

简而言之,当Elasticsearch无法在索引中定位到指定名称的geo_shape字段时,就会出现此错误。这可能是由于字段名拼写错误,或者该字段在索引中不存在。要解决此问题,您可以验证字段名并确保它存在于索引中。如果不存在,您可能需要创建它。此外,请确保该字段在索引映射中正确映射为geo_shape字段类型。

日志上下文 #

日志"failed to find geo_shape field [" + fieldName + “]“的类名是 GeoShapeQueryBuilder.java。我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:

final MappedFieldType fieldType = context.fieldMapper(fieldName);
if (fieldType == null) {
    if (ignoreUnmapped) {
        return new MatchNoDocsQuery();
    } else {
        throw new QueryShardException(context; "failed to find geo_shape field [" + fieldName + "]");
    }
} else if (fieldType.typeName().equals(BaseGeoShapeFieldMapper.CONTENT_TYPE) == false) {
    throw new QueryShardException(context;
    "Field [" + fieldName + "] is not of type [geo_shape] but of type [" + fieldType.typeName() + "]");
}