Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 46277 invoked from network); 21 Nov 2008 06:07:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2008 06:07:23 -0000 Received: (qmail 49640 invoked by uid 500); 21 Nov 2008 06:07:25 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 49612 invoked by uid 500); 21 Nov 2008 06:07:25 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 49601 invoked by uid 99); 21 Nov 2008 06:07:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Nov 2008 22:07:25 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.191.84.165] (HELO smtp116.mail.mud.yahoo.com) (209.191.84.165) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 21 Nov 2008 06:05:59 +0000 Received: (qmail 55566 invoked from network); 21 Nov 2008 06:05:43 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID:From:To:References:Subject:Date:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Priority:X-MSMail-Priority:X-Mailer:X-MimeOLE; b=Ie4RG3jIOfQzPAAWqGjuO2cAd7gehnRCM5AwG8jiMLX0GcjIAd9j8UKLHwU7b/q1bo98GA1X4OgEQo+g/67Mq2h6Z92LxEcoGDfleExBj+P8lweJqDssjT2+8RMmTsiwoMqArMwbPZPrRFN864A1KJrRdbNo755FjrVD+LZQcsQ= ; Received: from unknown (HELO GaneshM) (emailgane@203.98.194.130 with login) by smtp116.mail.mud.yahoo.com with SMTP; 21 Nov 2008 06:05:42 -0000 X-YMail-OSG: 0d7XaSMVM1kCA.1fjlKLuNlhPBIE7lDvufNLwwhQpPCiMYluEgkKobjOlXfAtkaEAOzrPNoxDKvQxYCLqqlY0tW3SHbVDEN9uhBW_FbedaqSzLtePlBvZK4agvD7btz3AkWkASH05pVGOfc_K8fHXVyDHQ-- X-Yahoo-Newman-Property: ymail-3 Message-ID: <030d01c94b9f$2fa70cd0$330bc30a@sv.us.sonicwall.com> From: "Ganesh" To: References: <20615647.post@talk.nabble.com> Subject: Re: how to sort the result by ignoring case in lucene Date: Fri, 21 Nov 2008 11:35:40 +0530 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Virus-Checked: Checked by ClamAV on apache.org You need to write your own sort comparator SortField(String field, SortComparatorSource comparator) Regards Ganesh ----- Original Message ----- From: "naveen.quill" To: Sent: Friday, November 21, 2008 11:27 AM Subject: how to sort the result by ignoring case in lucene > > Hi, > > I have a query regarding the sorting techniques in the lucene i.e > if i apply the sort method to the search results, lucene is sorting the > results by, without ignoring case, so, how to apply the sort technique > that > it should sort by ignoring case > > i.e : > if the results value are : {ACB, abc, adc, Aad}, > After sorting the results by lucene : {Aad, ACB, abc, adc} [here the > lucene > is taking uppercase words first to sort the results then lowercase], > but i need to get the results in this order : {Aad, abc, ACB, adc} > > so how to sort the results by ignoring case > > here is my code : > String queryComplex = "110_a_t:a* 110_a_t:A*"; > SortField sortField = new SortField("110_a_t", SortField.STRING); > Sort sort = new Sort(sortField); > QueryParser queryParser=new QueryParser("",new StandardAnalyzer()); > queryParser.setLowercaseExpandedTerms(false); > Query query = queryParser.parse(queryComplex); > org.apache.lucene.search.Hits > catalogueHits=search.indexSearcher.search(query, sort); > -- > View this message in context: > http://www.nabble.com/how-to-sort-the-result-by-ignoring-case-in-lucene-tp20615647p20615647.html > Sent from the Lucene - Java Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org > For additional commands, e-mail: java-user-help@lucene.apache.org > Send instant messages to your online friends http://in.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org