lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera" <ser...@gmail.com>
Subject Re: Comparable ScoreDoc
Date Sat, 08 Dec 2007 05:04:28 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 ...

What about access to inner fields? Like I wrote, Comparable are
self-contained in the sense that they know how to compare themselves to the
same instances. However Comparators can only compare public variables.

On Dec 6, 2007 7:20 PM, Michael Busch <buschmic@gmail.com> wrote:

> Shai Erera wrote:
>
> >
> > Comparators however have an advantage - in that specific case I could
> create
> > two Comparators: (1) compares by the score and then by doc (2) compares
> by
>
> That's why I hesitate to add the Comparable interface to ScoreDoc:
> Different people might want different implementations of compare(), and
> that makes it questionable which default compare() implementation we
> should commit. I think Comparator solves this problem quite nicely.
>
> -Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>


-- 
Regards,

Shai Erera

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message