mikemccand commented on code in PR #13315: URL: https://github.com/apache/lucene/pull/13315#discussion_r1608345538
########## lucene/core/src/java/org/apache/lucene/search/DisjunctionMatchesIterator.java: ########## @@ -194,6 +194,15 @@ private DisjunctionMatchesIterator(List<MatchesIterator> matches) throws IOExcep new PriorityQueue<MatchesIterator>(matches.size()) { @Override protected boolean lessThan(MatchesIterator a, MatchesIterator b) { + if (a.startPosition() == -1 && b.startPosition() == -1) { + try { + return a.startOffset() < b.startOffset() + || (a.startOffset() == b.startOffset() && a.endOffset() < b.endOffset()) + || (a.startOffset() == b.startOffset() && a.endOffset() == b.endOffset()); + } catch (IOException e) { + throw new IllegalArgumentException("Failed to retrieve term offset", e); + } + } Review Comment: It's weird that `start/endOffset` can throw `IOException` but `start/endPosition` do not :) Nothing to fix in this PR, just noting the inconsistency ... -- 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