From dev-return-78462-apmail-lucene-dev-archive=lucene.apache.org@lucene.apache.org Thu Sep 1 17:04:37 2011 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 77D7E8BD6 for ; Thu, 1 Sep 2011 17:04:37 +0000 (UTC) Received: (qmail 50174 invoked by uid 500); 1 Sep 2011 17:04:36 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 50022 invoked by uid 500); 1 Sep 2011 17:04:35 -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 50010 invoked by uid 99); 1 Sep 2011 17:04:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2011 17:04:35 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2011 17:04:33 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4AECF4A632 for ; Thu, 1 Sep 2011 17:04:13 +0000 (UTC) Date: Thu, 1 Sep 2011 17:04:13 +0000 (UTC) From: "Doron Cohen (JIRA)" To: dev@lucene.apache.org Message-ID: <528441958.7414.1314896653303.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <786810400.786.1314012809734.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (LUCENE-3390) Incorrect sort by Numeric values for documents missing the sorting field 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/LUCENE-3390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doron Cohen updated LUCENE-3390: -------------------------------- Attachment: LUCENE-3390.patch Attached patch fixing this bug. TestSort was enhanced to test the new setMissingValue() method - actually merging the test from trunk r1002460 (LUCENE-2671). All search test passed (running the rest now..) > Incorrect sort by Numeric values for documents missing the sorting field > ------------------------------------------------------------------------ > > Key: LUCENE-3390 > URL: https://issues.apache.org/jira/browse/LUCENE-3390 > Project: Lucene - Java > Issue Type: Bug > Components: core/search > Affects Versions: 3.3 > Reporter: Gilad Barkai > Priority: Minor > Labels: double, float, int, long, numeric, sort > Attachments: LUCENE-3390.patch, SortByDouble.java > > > While sorting results over a numeric field, documents which do not contain a value for the sorting field seem to get 0 (ZERO) value in the sort. (Tested against Double, Float, Int & Long numeric fields ascending and descending order). > This behavior is unexpected, as zero is "comparable" to the rest of the values. A better solution would either be allowing the user to define such a "non-value" default, or always bring those document results as the last ones. > Example scenario: > Adding 3 documents, 1st with value 3.5d, 2nd with -10d, and 3rd without any value. > Searching with MatchAllDocsQuery, with sort over that field in descending order yields the docid results of 0, 2, 1. > Asking for the top 2 documents brings the document without any value as the 2nd result - which seems as a bug? -- This message is automatically generated by JIRA. 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