iverase commented on PR #15991:
URL: https://github.com/apache/lucene/pull/15991#issuecomment-4397634984
I found the current implementation a bit confusing with all those type
checks, and it doesn't seem fully implemented for all query types.
I wonder if we should implement this in a more java idiomatic way, for
example by introducing a new base class for queries that can be used when
filtering on a primary sort, something like:
```java
public abstract class PrimarySortAlignedQuery extends Query {
/** Field constrained by this query. */
public abstract String boundField();
/** Whether a dense doc id interval can be derived on this leaf from
primary sort layout. */
public abstract boolean supportsDenseLeafRange(LeafReaderContext context)
throws IOException;
/** Matching docs as {@code [minDoc, maxDoc)} on this leaf, or {@code
null} if unknown / not dense. */
public abstract DocIdRange denseDocIdRangeOrNull(LeafReaderContext
context) throws IOException;
}
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]