lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Praveen Peddi" <ppe...@contextmedia.com>
Subject sorting on a non english based locale field
Date Wed, 29 Dec 2004 17:36:22 GMT
Hi fellow luceners,
I was looking at the lucene sorting code and it looks like lucene does consider locale into
account while sorting. So I assume lucene already handles for strings.

But in my case, I wrote my own SortComparator (StringIgnoreCaseSortComparator) to achieve
sorting similar to explorer sorting. Because lucene uses java's string.compareTo method and
that considers  "case" of each character, I can't use lucene's default string sorting.

The question is, how do I integrate Locale into my StringIgnoreCaseSortComparator while comparing
strings. Lucene's code gets the locale from SortField but I don't have access to SortField
in this comparator.

Any ideas???? Should StringIgnoreCaseSortComparator be just knowing the locale at the time
of instantiating?

Praveen

************************************************************** 
Praveen Peddi
Sr Software Engg, Context Media, Inc. 
email:ppeddi@contextmedia.com 
Tel:  401.854.3475 
Fax:  401.861.3596 
web: http://www.contextmedia.com 
************************************************************** 
Context Media- "The Leader in Enterprise Content Integration" 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message