lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Comparable ScoreDoc
Date Sat, 08 Dec 2007 06:55:24 GMT

: In general I would agree that people may want different implementations for
: compare(), but I hardly see that's the case for ScoreDoc. After all, you can
: either compare it by score or by doc (at least now). I believe that since
: most people use the TopDocsHitCollector, they prefer the compare-by-score
: approach ...

sure, but that's not all your suggested compareTo does ... it first 
compares by score and then does a secondary comparison by docId.  
some people might want docs added "more recently" to sort first instead, 
some might want docid left out of hte comparison all together.

This is where Comparators are more useful then compareTo methods.  We can 
add *lots* of different static inner Comparator classes to ScoreDoc, but 
if we add any compareTo method it could wind up burning someone down the 
road.


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message