Points only cannot be set to false for term strategy – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.1

Briefly, this error occurs when you’re trying to set the “points_only” parameter to false for a geo_shape field that uses the “term” strategy in Elasticsearch. The term strategy only supports point shapes, hence the error. To resolve this issue, you can either change the strategy to “recursive” or “vector”, which support various shapes, or ensure that your geo_shape field only contains point shapes if you want to continue using the “term” strategy.

This guide will help you check for common problems that cause the log ” points_only cannot be set to false for term strategy ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: index.

Log Context

Log “points_only cannot be set to false for term strategy” class name is LegacyGeoShapeFieldMapper.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 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) {