diff --git a/server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQuery.java b/server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQuery.java index 26ed3dbe4e48e..d8b5201ad90f6 100644 --- a/server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQuery.java +++ b/server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQuery.java @@ -84,10 +84,11 @@ public void visit(QueryVisitor visitor) { } @Override - public final ApproximateConstantScoreWeight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) throws IOException { + public final ApproximatePointRangeQueryWeight createWeight(IndexSearcher searcher, ScoreMode scoreMode, float boost) + throws IOException { Weight pointRangeQueryWeight = pointRangeQuery.createWeight(searcher, scoreMode, boost); - return new ApproximateConstantScoreWeight(this, boost) { + return new ApproximatePointRangeQueryWeight(this, boost) { private final ArrayUtil.ByteArrayComparator comparator = ArrayUtil.getUnsignedComparator(pointRangeQuery.getBytesPerDim()); diff --git a/server/src/main/java/org/opensearch/search/approximate/ApproximateConstantScoreWeight.java b/server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQueryWeight.java similarity index 76% rename from server/src/main/java/org/opensearch/search/approximate/ApproximateConstantScoreWeight.java rename to server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQueryWeight.java index aec84499a9f7b..941451f99f6a0 100644 --- a/server/src/main/java/org/opensearch/search/approximate/ApproximateConstantScoreWeight.java +++ b/server/src/main/java/org/opensearch/search/approximate/ApproximatePointRangeQueryWeight.java @@ -15,9 +15,12 @@ import java.io.IOException; -public abstract class ApproximateConstantScoreWeight extends ConstantScoreWeight { +/** + * Abstract implementation of {@link ConstantScoreWeight} for {@link ApproximatePointRangeQuery} + */ +public abstract class ApproximatePointRangeQueryWeight extends ConstantScoreWeight { - protected ApproximateConstantScoreWeight(Query query, float score) { + protected ApproximatePointRangeQueryWeight(Query query, float score) { super(query, score); } diff --git a/server/src/test/java/org/opensearch/search/approximate/ApproximatePointRangeQueryTests.java b/server/src/test/java/org/opensearch/search/approximate/ApproximatePointRangeQueryTests.java index 6e3f87362dc94..631ef0c26964c 100644 --- a/server/src/test/java/org/opensearch/search/approximate/ApproximatePointRangeQueryTests.java +++ b/server/src/test/java/org/opensearch/search/approximate/ApproximatePointRangeQueryTests.java @@ -340,7 +340,7 @@ protected String toString(int dimension, byte[] value) { } }; IndexSearcher searcher = new IndexSearcher(reader); - ApproximateConstantScoreWeight approximatePointRangeQueryWeight = approximatePointRangeQuery.createWeight( + ApproximatePointRangeQueryWeight approximatePointRangeQueryWeight = approximatePointRangeQuery.createWeight( searcher, ScoreMode.TOP_SCORES, 1.0F @@ -394,7 +394,7 @@ protected String toString(int dimension, byte[] value) { } }; IndexSearcher searcher = new IndexSearcher(reader); - ApproximateConstantScoreWeight approximatePointRangeQueryWeight = approximatePointRangeQuery.createWeight( + ApproximatePointRangeQueryWeight approximatePointRangeQueryWeight = approximatePointRangeQuery.createWeight( searcher, ScoreMode.TOP_SCORES, 1.0F