michaeljmarshall opened a new pull request, #16578: URL: https://github.com/apache/lucene/pull/16578
### Description I put this together as a draft to see what it'd look like to replace the `== MatchAllDocsQuery.class` checks. It seems valuable for `AbstractKnnVectorQuery` in the case where a `MatchAllDocsQuery` is wrapped in a `ConstantScoreQuery` or a `BoostQuery`, which can happen when a boolean query wraps a single `MatchAllDocsQuery` as a filter clause, because that is a case where we wouldn't want to add the filter. However, what is not clear is if the other `== MatchAllDocsQuery.class` checks can correctly use this new method or if we need something more careful. The primary benefit of this change is for `AbstractKnnVectorQuery` to skip building a filter. Adding a match all filter has two costs. First, we intersect with `new FieldExistsQuery(field)`, and second, we call `cost()` which eagerly materializes a fixed bitset, costing memory proportional to the number of docs. Leaving this as a draft for now, as I'm not sure the API design is quite right. I'll continue to think about it. -- 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]
