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

Earwin Burrfoot commented on LUCENE-1524:
-----------------------------------------

If you're not using a deterministic tie-breaker, in case of a tie you'll get 
random results even doing the same search over and over again. That has a 
chance to happen exactly after the next index segment merge. On merge, 
documents change their docIds and can even be reordered depending on how the 
segments are being merged. Seeing as you're not getting stable results for 
forward sort, I can't fathom how you're expecting reverse sort to give you 
something predictable.

I used two solutions to this problem - use docId as a tie-breaker, reversing it 
together with the primary field. That gave me some stability inbetween merges 
and nice sort reversal. Then I switched to using my application document id - 
it is constant during the life of a document, I need to retrieve it anyway for 
all the documents found, and for this exact reason it rests in a cache that 
makes sorting on that field lightning fast.

> True reverse sorting
> --------------------
>
>                 Key: LUCENE-1524
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1524
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 2.4
>            Reporter: Jiri Kuhn
>            Priority: Minor
>             Fix For: 2.4.1
>
>         Attachments: reverse.patch
>
>
> If documents sorted have the same sort value, they are sorted in the same way 
> even if the reverse flag is true.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to