Return-Path: Delivered-To: apmail-lucene-java-dev-archive@www.apache.org Received: (qmail 79525 invoked from network); 20 Mar 2006 06:26:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Mar 2006 06:26:09 -0000 Received: (qmail 92162 invoked by uid 500); 20 Mar 2006 06:25:56 -0000 Delivered-To: apmail-lucene-java-dev-archive@lucene.apache.org Received: (qmail 92113 invoked by uid 500); 20 Mar 2006 06:25:54 -0000 Mailing-List: contact java-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-dev@lucene.apache.org Delivered-To: mailing list java-dev@lucene.apache.org Received: (qmail 92065 invoked by uid 99); 20 Mar 2006 06:25:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Mar 2006 22:25:52 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Mar 2006 22:25:51 -0800 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id B08FE6ACAA for ; Mon, 20 Mar 2006 06:25:30 +0000 (GMT) Message-ID: <1522324756.1142835930720.JavaMail.jira@ajax> Date: Mon, 20 Mar 2006 06:25:30 +0000 (GMT) From: "Paul Cowan (JIRA)" To: java-dev@lucene.apache.org Subject: [jira] Created: (LUCENE-526) FieldSortedHitQueue - subsequent String sorts with different locales sort identically MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N FieldSortedHitQueue - subsequent String sorts with different locales sort identically ------------------------------------------------------------------------------------- Key: LUCENE-526 URL: http://issues.apache.org/jira/browse/LUCENE-526 Project: Lucene - Java Type: Bug Components: Search Versions: 1.9 Reporter: Paul Cowan >From my own post to the java-user list. I have looked into this further and am sure it's a bug. --- It seems to me that there's a possible bug in FieldSortedHitQueue, specifically in getCachedComparator(). This is showing up on our 1.4.3 install, but it seems from source code inspection that if it's a bug, it's in 1.9.1 also. The issue shows up when you need to sort results from a given IndexReader multiple times, using different locales. On line 180 (all line numbers from the 1.9.1 code), we have this: ScoreDocComparator comparator = lookup (reader, fieldname, type, factory); Then, if no comparator is found in the cache, a new one is created (line 193) and then stored in the cache (line 202). HOWEVER, both the cache lookup() and store() do NOT take into account locale; if we, on the same index reader, try to do one search sorted by Locale.FRENCH and one by Locale.ITALIAN, the first one will result in a cache miss, a new French comparator will be created, and stored in the cache. Second time through, lookup() finds the cached French comparator -- even though this time, the locale parameter to getCachedComparator() is an Italian locale. Therefore, we don't create a new comparator and we use the wrong one to sort the results. It looks to me (unless I'm mistaken) that the FieldCacheImpl.Entry class should have an additional property, .locale, to ensure that different locales get different comparators. --- Patch (well, most of one) to follow immediately. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org For additional commands, e-mail: java-dev-help@lucene.apache.org