版本: 6.8-7.1
简而言之,当你在 Elasticsearch 中为使用 “term” 策略的 geo_shape 字段尝试将 “points_only” 参数设置为 false 时,会发生此错误。term 策略仅支持点形状,因此会报错。要解决此问题,你可以将策略更改为支持各种形状的 “recursive” 或 “vector”,或者如果你想继续使用 “term” 策略,请确保你的 geo_shape 字段仅包含点形状。
日志上下文 #
日志 “points_only cannot be set to false for term strategy” 的类名是 LegacyGeoShapeFieldMapper.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
this.precision = precision;
} public void setPointsOnly(boolean pointsOnly) {
if (this.strategy == SpatialStrategy.TERM && pointsOnly == false) {
throw new ElasticsearchParseException("points_only cannot be set to false for term strategy");
}
this.pointsOnly = pointsOnly;
} public void setDistanceErrorPct(double distanceErrorPct) {





