javanna commented on code in PR #11793: URL: https://github.com/apache/lucene/pull/11793#discussion_r975048307
########## 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 = + new PointValues() { + @Override + public PointTree getPointTree() { + return EMPTY_POINT_TREE; + } + + @Override + public byte[] getMinPackedValue() { + return null; + } + + @Override + public byte[] getMaxPackedValue() { + return null; Review Comment: returning null here does not feel great, yet I did not find a better way that fits in the existing code. I tried the empty array but it required changes in how the return value is consumed. -- 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