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

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

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.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

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

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?