javanna commented on code in PR #11793:
URL: https://github.com/apache/lucene/pull/11793#discussion_r976257408


##########
lucene/core/src/java/org/apache/lucene/search/comparators/NumericComparator.java:
##########
@@ -104,28 +104,28 @@ public abstract class NumericLeafComparator implements 
LeafFieldComparator {
 
     public NumericLeafComparator(LeafReaderContext context) throws IOException 
{
       this.docValues = getNumericDocValues(context, field);
-      this.pointValues = canSkipDocuments ? 
context.reader().getPointValues(field) : null;
-      if (pointValues != null) {
-        FieldInfo info = context.reader().getFieldInfos().fieldInfo(field);
-        if (info == null || info.getPointDimensionCount() == 0) {
-          throw new IllegalStateException(
-              "Field "
-                  + field
-                  + " doesn't index points according to FieldInfos yet returns 
non-null PointValues");
-        } else if (info.getPointDimensionCount() > 1) {
-          throw new IllegalArgumentException(
-              "Field " + field + " is indexed with multiple dimensions, 
sorting is not supported");
-        } else if (info.getPointNumBytes() != bytesCount) {
-          throw new IllegalArgumentException(
-              "Field "
-                  + field
-                  + " is indexed with "
-                  + info.getPointNumBytes()
-                  + " bytes per dimension, but "
-                  + NumericComparator.this
-                  + " expected "
-                  + bytesCount);
-        }
+      FieldInfo info = context.reader().getFieldInfos().fieldInfo(field);
+      if (info == null || info.getPointDimensionCount() == 0) {
+        throw new IllegalStateException(

Review Comment:
   yes this is wrong, I pushed a fix: the idea is that we don't need to check 
consistency between FieldInfo and getPointValues here, hence the first 
exception can go away. We check fieldinfo and we let that drive our decisions, 
and retrieve points based on what field info says.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to