You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Simon Willnauer (JIRA)" <ji...@apache.org> on 2018/12/07 17:30:00 UTC
[jira] [Updated] (LUCENE-8592) MultiSorter#sort incorrectly sort
Integer/Long#MIN_VALUE when the natural sort is reversed
[ https://issues.apache.org/jira/browse/LUCENE-8592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Simon Willnauer updated LUCENE-8592:
------------------------------------
Affects Version/s: master (8.0)
7.5
Priority: Blocker (was: Major)
Fix Version/s: master (8.0)
7.6
> MultiSorter#sort incorrectly sort Integer/Long#MIN_VALUE when the natural sort is reversed
> ------------------------------------------------------------------------------------------
>
> Key: LUCENE-8592
> URL: https://issues.apache.org/jira/browse/LUCENE-8592
> Project: Lucene - Core
> Issue Type: Bug
> Affects Versions: 7.5, master (8.0)
> Reporter: Jim Ferenczi
> Priority: Blocker
> Fix For: 7.6, master (8.0)
>
> Attachments: LUCENE-8592.patch
>
>
> MultiSorter#getComparableProviders on an integer or long field doesn't handle MIN_VALUE correctly when the natural order is reversed. To handle reverse sort we use the negation of the value but there is no check for overflows so MIN_VALUE for ints and longs are always sorted first (even if the natural order is reversed).
> This method is used by index sorting when merging already sorted segments together. This means that a sorted index can be incorrectly sorted if it uses a reverse sort and a missing value set to MIN_VALUE (long or int or values inside the segment that are equals to MIN_VALUE).
> This a bad bug because it affects the documents order inside segments and only a reindex can restore the correct sort order.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org