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


##########
lucene/core/src/java/org/apache/lucene/index/PointValues.java:
##########
@@ -467,4 +467,91 @@ public final long estimateDocCount(IntersectVisitor 
visitor) {
 
   /** Returns the total number of documents that have indexed at least one 
point. */
   public abstract int getDocCount();
+
+  private static final PointTree EMPTY_POINT_TREE =
+      new PointTree() {
+        @Override
+        public PointTree clone() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public boolean moveToChild() {
+          return false;
+        }
+
+        @Override
+        public boolean moveToSibling() {
+          return false;
+        }
+
+        @Override
+        public boolean moveToParent() {
+          return false;
+        }
+
+        @Override
+        public byte[] getMinPackedValue() {
+          return new byte[0];
+        }
+
+        @Override
+        public byte[] getMaxPackedValue() {
+          return new byte[0];
+        }
+
+        @Override
+        public long size() {
+          return 0;
+        }
+
+        @Override
+        public void visitDocIDs(IntersectVisitor visitor) {}
+
+        @Override
+        public void visitDocValues(IntersectVisitor visitor) {}
+      };
+
+  public static final PointValues EMPTY =

Review Comment:
   One issue that the other PR regarding ghost fields and terms highlighted is 
that we should tune this empty instance so that it returns correct values for 
field metadata such as numbers of dimensions. Otherwise any code that would be 
checking the number of dimensions via this empty instance could be retrieving 
wrong numbers. See e.g. `checkValidPointValues` in `PointRangeQuery`.



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