uschindler commented on PR #13389: URL: https://github.com/apache/lucene/pull/13389#issuecomment-2120667481
> * Lot of [interval functions](https://github.com/apache/lucene/tree/main/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/nodes/intervalfn) ( around 21 usage ) indirectly can end up using the null iterator which expected `NO_INTERVAL` before. There are other places as well which don't seem to extensively covered by UTs. > * Existing users of `Intervals.atLeast` expect a null iterator to be returned for some cases. > > To support both behaviours, we can create a new constructor for`NoMatchIntervalsSource` which returns `NO_INTERVAL` style iterator instead of null to keep this change safe. > > The new API can use this constructor instead of existing one. No need for separate variants. The interval query parser just constructs queries, it never executes them. We only have to check if the interval code works correct with null iterator. Users of Lucene are common to null iterators. They are used everywhere (scorer, doc id sets,...). Returning null is much easier than crazy logic with -1 and NO_MORE_DOCS. -- 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