iverase commented on a change in pull request #7: URL: https://github.com/apache/lucene/pull/7#discussion_r728661706
########## File path: lucene/core/src/java/org/apache/lucene/codecs/PointsWriter.java ########## @@ -74,63 +74,100 @@ public PointValues getValues(String fieldName) { @Override public IndexTree getIndexTree() { - throw new UnsupportedOperationException(); - } + return new IndexTree() { - @Override - public void intersect(IntersectVisitor mergedVisitor) throws IOException { - for (int i = 0; i < mergeState.pointsReaders.length; i++) { - PointsReader pointsReader = mergeState.pointsReaders[i]; - if (pointsReader == null) { - // This segment has no points - continue; + @Override + public IndexTree clone() { + throw new UnsupportedOperationException(); } - FieldInfo readerFieldInfo = mergeState.fieldInfos[i].fieldInfo(fieldName); - if (readerFieldInfo == null) { - // This segment never saw this field - continue; + + @Override + public boolean moveToChild() { + return false; } - if (readerFieldInfo.getPointDimensionCount() == 0) { - // This segment saw this field, but the field did not index points in it: - continue; + @Override + public boolean moveToSibling() { + return false; } - PointValues values = pointsReader.getValues(fieldName); - if (values == null) { - continue; + @Override + public boolean moveToParent() { + return false; } - MergeState.DocMap docMap = mergeState.docMaps[i]; - values.intersect( - new IntersectVisitor() { - @Override - public void visit(int docID) { - // Should never be called because our compare method never returns - // Relation.CELL_INSIDE_QUERY - throw new IllegalStateException(); - } - - @Override - public void visit(int docID, byte[] packedValue) throws IOException { - int newDocID = docMap.get(docID); - if (newDocID != -1) { - // Not deleted: - mergedVisitor.visit(newDocID, packedValue); - } - } - - @Override - public Relation compare(byte[] minPackedValue, byte[] maxPackedValue) { - // Forces this segment's PointsReader to always visit all docs + values: - return Relation.CELL_CROSSES_QUERY; - } - }); - } - } - @Override - public long estimatePointCount(IntersectVisitor visitor) { - throw new UnsupportedOperationException(); + @Override + public byte[] getMinPackedValue() { + return new byte[0]; Review comment: That would not work because we are calling intersects and it always call this method. On the other hand this made me think that probably we are using the wrong implementation call for MutablePointValues. Because of the introduction of the PointTree (formely IndexTree), we should move from MutablePointValues to MutablePointTree. This will have the same effect that what I was proposing in #371. I made that modification in https://github.com/apache/lucene/pull/7/commits/19e5dee67fb2fa80ecce09ea9620d67811c34f64. -- 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