gsmiller opened a new pull request, #12853:
URL: https://github.com/apache/lucene/pull/12853

   In GH#12558, @Shradha26 discovered that faceting implementations are 
sometimes getting empty MatchingDoc lists, resulting in undesired behavior. We 
should consider it a bug for MatchingDocs to not be populated, even if there 
are no collected hits. After chasing the issue a bit, it appears that 
drill-sideways can miss calling `#finish` on the FacetsCollectors it manages if 
it end up not scoring any docs. This PR addresses it.
   
   I made a couple related changes in this PR to get at fixing the bug:
   1. Added `DrillSideways#createDrillSidewaysFacetsCollectorManager` as a 
protected method that users can extend to create specific facet collecting 
implementations. This seems reasonable to me as we already have a similar hook 
for the drill-down collector. I found this hook useful for testing. If we don't 
want to expose this API surface, I can adjust the testing approach, but I think 
it's reasonable to expose personally.
   2. Changed the `DrillSidewaysScorer` to accept `LeafCollectors` instead of 
`FacetCollectors`. This seems like a better division of responsibilities 
anyway, and is simpler, but it also lets `DrillSidewaysQuery` manage the 
creation of the leaf collectors when setting up the `BulkScorer`. This is 
necessary if `DrillSidewaysQuery` is going to call `#finish` in no-scoring 
cases since `#finish` relies on a leaf scorer having been created already from 
the collector.
   3. I also added a TODO to go remove 
`DrillSideways#createDrillDownFacetsCollector` since it is no longer used and 
is a trappy hook for users. I'll tackle this in a separate PR though since we 
need a deprecation back port and it's not really related to this (just 
something I came across).


-- 
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

Reply via email to