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:

com.ibm.icu.text.Collator collator = com.ibm.icu.text.Collator.getInstance(new ULocale(column.locale));
collator.setStrength(Collator.SECONDARY);
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: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to