lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Kaser <>
Subject Using DocValues with CollationKeyAnalyzer
Date Tue, 06 Nov 2012 14:04:19 GMT
Hi all,

for best performance, I use a SortedBytesDocValuesField to sort results. 
I would like to use a ICUCollationKeyAnalyzer for this field, so sorting 
occurs in a "natural" order.
However, it seems as if the SortedBytesDocValuesField does not use an 
analyzers, but expects a ByteRef which is stored "as-is".
Is this correct?

So far, this is the best I could come up with: collator = ULocale(column.locale));
RawCollationKey key = collator.getRawCollationKey("field_value", null);
BytesRef bytes=new BytesRef(key.bytes, 0, key.size);
SortedBytesDocValuesField sortfield = new 
SortedBytesDocValuesField("sort_field", bytes);

So I don't use the analyzer, but instead "simulate" its behaviour.
Is there another way, or is SortedBytesDocValuesField meant to be used 
like that?

Best Regards,
Christoph Kaser


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message