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

Adrien Grand commented on LUCENE-8819:
--------------------------------------

TopDocs#merge has two use-cases, one is to merge results that come from 
multiple slices of the same IndexSearcher, another one is to merge results that 
come from different IndexSearchers (shards). In the latter case, tie-breaking 
by doc ID is not enough as you could have documents in multiple shards that 
share the same doc ID, which is why it tie-breaks by shard ID first.

We seem to get bitten by the fact that the merging of results from different 
slices treats each slice as a different shard, so this gives the expected 
results if for every X < Y, doc IDs of slice X are all less than doc IDs of 
slice Y.

I haven't looked deeply, but I guess my preferred option would be to have a way 
to signal to TopDocs#merge that all hits come from the same shard so that it 
would tie break directly by doc ID. But it looks like it requires quite some 
changes as it would break a number of assumptions. 

> org.apache.lucene.search.TestTopDocsMerge.testSort_1 failure
> ------------------------------------------------------------
>
>                 Key: LUCENE-8819
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8819
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Ignacio Vera
>            Priority: Major
>         Attachments: LUCENE-8819.patch
>
>
> It can be reproduced with:
>  
> {code:java}
> ant test  -Dtestcase=TestTopDocsMerge -Dtests.method=testSort_1 
> -Dtests.seed=E916688CE5BC9122 -Dtests.multiplier=3 -Dtests.slow=true 
> -Dtests.locale=es-US -Dtests.timezone=Pacific/Johnston -Dtests.asserts=true 
> -Dtests.file.encoding=ISO-8859-1{code}
>  
> Test fails in master and branch 8.x but it does not fail in branch 8.1. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to