gsmiller commented on issue #11547: URL: https://github.com/apache/lucene/issues/11547#issuecomment-1546327008
@stefanvodita it's been a while since I looked at this, and @LuXugang had the idea originally so he's really best positioned to clarify, but since you haven't gotten a response yet, I'll attempt to describe what I _think_ this is capturing. In faceting, we have this pattern where we intersect the collected hits (from a `FacetsCollector`) with some doc values iterator. We tend to do this with `ConjunctionUtils#intersectIterators`. I think the observation is that, if every doc in a segment matched (and it being faceted on), we could just iterate the doc values directly without the intersection. We can know this with `FacetsCollector` since `MatchingDocs$totalHits` would equal the number of docs in the segment. I don't see a way to do this directly in `ConjunctionUtils#intersectIterators` since—as you point out—we can't generally know the number of hits an iterator will provide up-front. I guess we could have some new utility method that intersects a `MatchingDocs` instance with other iterators? This feels clunky to me though, and I don't like the idea of adding to a general utility for such a specific case. We could add some conditional logic in faceting implementations that optimizes for this case I suppose. Most faceting implementations already have a "facet on everything" type implementation that we could delegate to? To be honest, I'm not sure this is a particularly common use-case, or that we'll see meaningful performance from it, but we could benchmark and see? Anyway, this is my interpretation, but I may be missing something. -- 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