I've never really looked at the javadocs for Collator much before
yesterday, but I just noticed a comment about a class i'd never heard of:
CollationKey ...

> For comparing Strings exactly once, the compare method provides the best
> performance. When sorting a list of Strings however, it is generally
> necessary to compare each String multiple times. In this case,
> CollationKeys provide better performance. The CollationKey class
> converts a String to a series of bits that can be compared bitwise
> against other CollationKeys. A CollationKey is created by a Collator
> object for a given String.

this is exactly what FieldSortedHitQueue does in the ScoreDocComparator
returned by comparatorStringLocale -- and it got me thinking, perhaps it
would be worthwhile for comparatorStringLocale to convert the String[] it
gets back from FieldCache.DEFAULT.getStrings to a new CollationKey[]?

or maybe even for FieldCache.DEFAULT.getStrings to be deprecated, and
replaced with a FieldCache.DEFAULT.getCollationKeys(reader,field,Collator)

        ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to