lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Sorting case insensitive wildcard query (with highlight)
Date Fri, 12 Mar 2010 10:51:32 GMT
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 <kevinkilroy@hotmail.com> wrote:
>
> 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 = {
>        @Field(index = Index.TOKENIZED, store = Store.YES),
>        @Field(name = "name_forSort", index = Index.UN_TOKENIZED, store = Store.NO),
>    })
>
> Therefore, I can search on the 1st field, & sort on the second field. This 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 results back as
expected, however, when I search, the (highlighted) results come 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


Mime
View raw message