You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by wawa <sh...@hotmail.com> on 2007/01/10 17:03:40 UTC
Ingnore Case in Sorting
Hello,
I wonder that there is anyway to ignore case(up & lower) in sorting.
I just used Sort() method and Lucene sorted result Uppercase first and then
lowercase.
ex)
Apple
Banana
apple
Is there a way to sort like below?:
Apple
apple
Banana
--
View this message in context: http://www.nabble.com/Ingnore-Case-in-Sorting-tf2953305.html#a8260262
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
Re: Ingnore Case in Sorting
Posted by Erick Erickson <er...@gmail.com>.
You could always implement your own sorter, but I really have to ask why you
are storing things in your index case-sensitive in the first place. In the
above example, if you're searching on "banana", you'll get no hits. That may
be your desired behavior....
You could also store a sort field in your index that's lower-cased and sort
on that (as well as the case-sensitive field)
On 1/10/07, wawa <sh...@hotmail.com> wrote:
>
>
> Hello,
>
> I wonder that there is anyway to ignore case(up & lower) in sorting.
> I just used Sort() method and Lucene sorted result Uppercase first and
> then
> lowercase.
>
> ex)
> Apple
> Banana
> apple
>
> Is there a way to sort like below?:
>
> Apple
> apple
> Banana
> --
> View this message in context:
> http://www.nabble.com/Ingnore-Case-in-Sorting-tf2953305.html#a8260262
> 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
>
>