From java-user-return-45402-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Fri Mar 12 10:52:59 2010 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 38505 invoked from network); 12 Mar 2010 10:52:59 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 12 Mar 2010 10:52:59 -0000 Received: (qmail 61165 invoked by uid 500); 12 Mar 2010 10:52:20 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 61105 invoked by uid 500); 12 Mar 2010 10:52:20 -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 61097 invoked by uid 99); 12 Mar 2010 10:52:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2010 10:52:20 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ian.lea@gmail.com designates 209.85.218.217 as permitted sender) Received: from [209.85.218.217] (HELO mail-bw0-f217.google.com) (209.85.218.217) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Mar 2010 10:52:13 +0000 Received: by bwz9 with SMTP id 9so936710bwz.5 for ; Fri, 12 Mar 2010 02:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=BD4ZXEcL7kXOQxp34+nOMSwKWUJ+pGY4eobLjAySp3g=; b=BfQs2LepykGpB72OoZXcwvEiSIT2CXyXiN/2wS62hhtyESXHdzglut0EHek3Q6w7MG Cr6tUduoQW7fUqOoStkmHeDpvTx1gycDVlidNRLFiA4j4W/IiwswQ4Xg8G3ZEgnE/b+m eDeN2qUCDJurCYEhfvKGfM6PxURAXu6BMB5YU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Z3dcuwdLctl9gVmA5QDwbvoiHlTTSZK3ujdYdA+TUNzjfz+1weCU5CmvzC0EKxY5lD mesHbH2RRRPUTiNEkEeMocRH9C0W1UVo+UyfDcVBUKrbymAnBEfFF8VduB73X2d01LsK ESlNj24UPfx2CeE2hRqqQZh2p4ZiXOmYg+Fh8= MIME-Version: 1.0 Received: by 10.204.7.146 with SMTP id d18mr185487bkd.101.1268391112311; Fri, 12 Mar 2010 02:51:52 -0800 (PST) In-Reply-To: References: From: Ian Lea Date: Fri, 12 Mar 2010 10:51:32 +0000 Message-ID: <8c4e68611003120251t34bdef85ge832731f1b8a660d@mail.gmail.com> Subject: Re: Sorting case insensitive wildcard query (with highlight) To: java-user@lucene.apache.org, kevinkilroy@hotmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Can you just lowercase a dedicated sort field and leave the others alone. -- Ian. On Fri, Mar 12, 2010 at 10:47 AM, Kev Kilroy wrot= e: > > Hi, > > I'm using Lucene 2.4.1 with Hibernate Search 3.1.1. I have objects in the= index, for each field I index as follows: > > @Fields( value =3D { > =A0 =A0 =A0 =A0@Field(index =3D Index.TOKENIZED, store =3D Store.YES), > =A0 =A0 =A0 =A0@Field(name =3D "name_forSort", index =3D Index.UN_TOKENIZ= ED, store =3D Store.NO), > =A0 =A0}) > > Therefore, I can search on the 1st field, & sort on the second field. Thi= s works fine, however, the sorting results are case sensitive. > > So, for example my results come back as: > > A > B > C > a > > But I would like > > a > A > B > C > > If I lowercase everything when I create the index, I do indeed get the re= sults back as expected, however, when I search, the (highlighted) results c= ome back in lower case. > > For example: if I search for: d Or D (note I am using wildcard queries (d= *) > > I get: > > dorcan road, > > whereas, when I just list the results it comes back as Dorcan Road (which= is what I want). > > Can anybody provide an example of how I can sort case insensitively? > > Thanks in advance, > > Kevin. > > > _________________________________________________________________ > Tell us your greatest, weirdest and funniest Hotmail stories > http://clk.atdmt.com/UKM/go/195013117/direct/01/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org