lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Keegan" <peter.kee...@charter.net>
Subject Re: Ordening documents
Date Sat, 17 Jan 2004 22:54:16 GMT
So they are sorted by reverse document number. Is this the 'external'
document number (the one that is adjusted for the segment's base)? If so,
then this means that documents with equal score are returned in the order in
which they were added to the index.  Is this correct?

Thanks,
Peter

----- Original Message ----- 
From: "Morus Walter" <morus.walter@gmx.de>
To: "Lucene Users List" <lucene-user@jakarta.apache.org>
Sent: Saturday, January 17, 2004 4:57 PM
Subject: Re: Ordening documents


> Peter Keegan writes:
> > What is the returned order for documents with identical scores?
> have a look at the source of the lessThan method in
> org.java.lucene.search.HitQueue:
>
> protected final boolean lessThan(Object a, Object b) {
>     ScoreDoc hitA = (ScoreDoc)a;
>     ScoreDoc hitB = (ScoreDoc)b;
>     if (hitA.score == hitB.score)
>       return hitA.doc > hitB.doc;
>     else
>       return hitA.score < hitB.score;
> }
>
> sorting is done by this method.
>
> HTH
> Morus
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org
>
>


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


Mime
View raw message