diff --git a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java index 27c1642e1fe..2eebb59dc6b 100644 --- a/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java +++ b/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/NumberRangePrefixTree.java @@ -744,7 +744,7 @@ public abstract class NumberRangePrefixTree extends SpatialPrefixTree { return SpatialRelation.INTERSECTS; } for (;nrMaxLevel < getLevel(); nrMaxLevel++) { - if (getValAtLevel(nrMaxLevel + 1) != getNumSubCells(getLVAtLevel(nrMaxLevel-1)) - 1) + if (getValAtLevel(nrMaxLevel + 1) != getNumSubCells(getLVAtLevel(nrMaxLevel)) - 1) return SpatialRelation.INTERSECTS; } return SpatialRelation.CONTAINS;