Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D3FF10B24 for ; Tue, 16 Apr 2013 21:23:18 +0000 (UTC) Received: (qmail 54599 invoked by uid 500); 16 Apr 2013 21:23:17 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 54522 invoked by uid 500); 16 Apr 2013 21:23:17 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 54418 invoked by uid 99); 16 Apr 2013 21:23:17 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Apr 2013 21:23:17 +0000 Date: Tue, 16 Apr 2013 21:23:17 +0000 (UTC) From: "Uwe Schindler (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-4723) sort order different in branch_4x than trunk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-4723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13633382#comment-13633382 ] Uwe Schindler commented on SOLR-4723: ------------------------------------- The pre-trunk code is wrong for comparing doubles/floats, as v1 > v2 does not work with +/-0 (its identical for operators <, >, ==). In Java 7, Double/Float.compare() compares the bits. The easiest way to solve the problem is using NumericUtils.doubleToSortableLong/floatToSortableInt and then compare the long/int. NumericUtils converts the floating point value to an integer, with fixing the sign to be comparable like a int (see javadocs). I think this is a corner case (like the crazy bugs if the score is NaN), so maybe we should only fix in 5.0 but leave 4.x and all previous lucene versions as they are. > sort order different in branch_4x than trunk > -------------------------------------------- > > Key: SOLR-4723 > URL: https://issues.apache.org/jira/browse/SOLR-4723 > Project: Solr > Issue Type: Bug > Reporter: Robert Muir > Attachments: SOLR-4723_test.patch > > > I will buy a beer to whoever figures out why +0 sorts before -0 in branch_4x, but works correctly in trunk :) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org