: Suppose one wanted to use this custom rounding score comparator on all
: fields and all queries. How would you get it plugged in most efficiently,
: given that SortField requires a non-null field name?

i'm not sure i understand the first part of question .. this custom
SortComparatorSource would deal only with the score, it wouldn't matter
what other fields you'd want to make SortFields on to do secondary
sorting. .. You as the client have to specify the Sort obejct when
executing the search, and you can build that Sort object up anyway you
want.

Yes the SortField class has a constructor arg for field, but
as you can see from the javadocs, it can be null in many circumstances
(consider SortFiled#FIELD_SCORE and SortField#FIELD_DOC for instance) ...
hmmm, actually i see now that SortField(String,SortComparatorSource) says
it cannot be null ... not sure if that's actually enforced or not, but
it's no bother -- all that matters is that you don't make any attempt to
use the field name in your SortComparatorSource.


-Hoss


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

Reply via email to