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

Diego Ceccarelli commented on LUCENE-8996:
------------------------------------------


Interesting - I'm curious to dig into why the distribute query returned 
{{maxScores==Float.MIN}} given that with [~cpoerschke] we thought very rare to 
happen. 
It seems that the query that produced the failure: 

{code:java}
... webapp= path=/select 
params={q=*:*&shards=http://127.0.0.1:62435/collection1|[ff01::213]:33332/|[ff01::114]:33332/|[ff01::083]:33332/&fl=id,a_i1&group.limit=-1&sort=a_i1+asc,+id+asc&rows=100&wt=javabin&version=2&group.field=a_i1&group=true}
 status=0 QTime=10
   [junit4]   2> 2169480 ERROR 
(TEST-TestDistributedGrouping.test-seed#[9532D3AC873FA0D8]) [     ] 
o.a.s.BaseDistributedSearchTestCase Mismatched responses:

{code}

.. was a MatchAll {{*:*}} + sort - I'm wondering if this particular combination 
produces some particular effect on the computation of MaxScore, I'm going to 
play with the unit tests. 

> maxScore is sometimes missing from distributed grouped responses
> ----------------------------------------------------------------
>
>                 Key: LUCENE-8996
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8996
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 5.3
>            Reporter: Julien Massenet
>            Assignee: Christine Poerschke
>            Priority: Minor
>         Attachments: LUCENE-8996.02.patch, LUCENE-8996.03.patch, 
> LUCENE-8996.patch, LUCENE-8996.patch, lucene_6_5-GroupingMaxScore.patch, 
> lucene_solr_5_3-GroupingMaxScore.patch, master-GroupingMaxScore.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This issue occurs when using the grouping feature in distributed mode and 
> sorting by score.
> Each group's {{docList}} in the response is supposed to contain a 
> {{maxScore}} entry that hold the maximum score for that group. Using the 
> current releases, it sometimes happens that this piece of information is not 
> included:
> {code}
> {
>   "responseHeader": {
>     "status": 0,
>     "QTime": 42,
>     "params": {
>       "sort": "score desc",
>       "fl": "id,score",
>       "q": "_text_:\"72\"",
>       "group.limit": "2",
>       "group.field": "group2",
>       "group.sort": "score desc",
>       "group": "true",
>       "wt": "json",
>       "fq": "group2:72 OR group2:45"
>     }
>   },
>   "grouped": {
>     "group2": {
>       "matches": 567,
>       "groups": [
>         {
>           "groupValue": 72,
>           "doclist": {
>             "numFound": 562,
>             "start": 0,
>             "maxScore": 2.0378063,
>             "docs": [
>               {
>                 "id": "29!26551",
>                 "score": 2.0378063
>               },
>               {
>                 "id": "78!11462",
>                 "score": 2.0298104
>               }
>             ]
>           }
>         },
>         {
>           "groupValue": 45,
>           "doclist": {
>             "numFound": 5,
>             "start": 0,
>             "docs": [
>               {
>                 "id": "72!8569",
>                 "score": 1.8988966
>               },
>               {
>                 "id": "72!14075",
>                 "score": 1.5191172
>               }
>             ]
>           }
>         }
>       ]
>     }
>   }
> }
> {code}
> Looking into the issue, it comes from the fact that if a shard does not 
> contain a document from that group, trying to merge its {{maxScore}} with 
> real {{maxScore}} entries from other shards is invalid (it results in NaN).
> I'm attaching a patch containing a fix.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to