[ 
https://issues.apache.org/jira/browse/SOLR-18550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130683#comment-18130683
 ] 

ASF subversion and git services commented on SOLR-18550:
--------------------------------------------------------

Commit 79b23df58daac14b92cc35f23b8b81f72098b4ba in solr's branch 
refs/heads/main from Puneet Ahuja
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=79b23df58da ]

SOLR-18550: Fix numFound and numFoundExact for CombinedQuery (#5172)

For combined queries (e.g. RRF), numFound is the distinct fused document count 
when numFoundExact
  is true, and otherwise a lower bound of at least the largest sub-query's 
match count,
  marked inexact when a sub-query list was truncated by the fusion pool 
(shards.rows
  or start + rows).

> Wrong numFound and numFoundExact for Combined Query results
> -----------------------------------------------------------
>
>                 Key: SOLR-18550
>                 URL: https://issues.apache.org/jira/browse/SOLR-18550
>             Project: Solr
>          Issue Type: Bug
>    Affects Versions: 10.1, 9.11
>            Reporter: Puneet Ahuja
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> For a combined query, the coordinator reports {{numFound}} as the largest 
> sub-query's match count, not the distinct document count of the fused result.
> Reported on [[email protected]|mailto:[email protected]] by Justin 
> Michael Coyne, verified on 10.1.0-rc2
> Both symptoms are in {{{}CombinedQueryComponent.mergeIds{}}}:
>  * {{numFound = max(numFound, queryNumFound)}} keeps the larger list's count 
> (3) instead of the fused count (5).
>  * The exactness check is inverted: {{hitCountIsExact = hitCountIsExact && 
> Boolean.FALSE.equals(docs.getNumFoundExact())}} makes an exact shard count 
> report as inexact and an inexact one stay exact.
> {{QueryComponent.mergeIds}} has the correct form for comparison. The 
> {{numFound--}} in the queue-overflow branch is dead code, overwritten by the 
> max right after.
> h2. Solution:
>  * Report {{numFound}} as the distinct number of fused documents.
>  * Set {{numFoundExact}} false when a sub-query list was truncated by the 
> fusion pool ({{{}shards.rows{}}}, {{{}start + rows{}}}, or knn {{{}topK{}}}), 
> and fix the conjunction.
>  * Remove the dead {{{}numFound--{}}}.
> The feature shipped in 9.11.0 and 10.1.0, so both lines are affected.
> Related: SOLR-17319 (the combined query feature). The fix is independent of 
> SOLR-18542 / [#5119|https://github.com/apache/solr/pull/5119], which only 
> touches ReciprocalRankFusion.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to