from your previous post about memory..."Every time you sort on a field, a FieldCache array is constructed for that field."
would that happen in this case for the field this comparator is not using? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Hostetter Sent: Wednesday, February 01, 2006 4:06 PM To: java-user@lucene.apache.org Subject: RE: Sorting by Score : I've not used the sorting code yet, but it looks like you have to : provide some custom ScoreDocComparator by adding a SortField using the : SortField(String field, SortComparatorSource comparator) constructor. : I'm just not certain what you should specify for the field value since : you really want to just round off the score. : : Could someone with more experience using the Sort API clarify whether : this is possible? yes, it should be possible, and yes your description of a solution sounds right ... the only odd thing is you'd be writting a SortComparatorSource/ScoreDocComparator that would be ignoring the field it's given, but there's nothing wrong with that. Round your number to the desired precision, then compare them, and return 0 if they are equal so that the secondary sort (on date in this case) can take affect. -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]