You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Naama Kraus <na...@gmail.com> on 2010/06/13 15:38:49 UTC

Scores equality

Hi All,

I wanted to ask regarding search results scores equality:
In case two documents get an equal score - how does Lucene "break" equality
?
I.e. by which criteria one document would be ranked before another ? Random
? Indexing time ? Anything else ?
Can I control this one somehow ?
(I am using Lucene 3).

Thanks for the input,
Naama

Re: Scores equality

Posted by Naama Kraus <na...@gmail.com>.
Thanks a lot, this is very helpful !
Naama

On Sun, Jun 13, 2010 at 5:05 PM, Erick Erickson <er...@gmail.com>wrote:

> Last I knew, ties were decided by the internal document id.
>
> you can control this any way you want, just include a Sort
> object in your query with multiple SortFields. Two pre-defined
> SortFields types you can use are FIELD_SCORE and
> FIELD_DOC and you can add any number of other fields to sort by,
> see the API for Sort and SortField...
>
> The default is pretty much equivalent to a Sort object with two
> SortFields, the two mentioned above...
>
> HTH
> Erick
>
> On Sun, Jun 13, 2010 at 9:38 AM, Naama Kraus <na...@gmail.com> wrote:
>
> > Hi All,
> >
> > I wanted to ask regarding search results scores equality:
> > In case two documents get an equal score - how does Lucene "break"
> equality
> > ?
> > I.e. by which criteria one document would be ranked before another ?
> Random
> > ? Indexing time ? Anything else ?
> > Can I control this one somehow ?
> > (I am using Lucene 3).
> >
> > Thanks for the input,
> > Naama
> >
>

Re: Scores equality

Posted by Erick Erickson <er...@gmail.com>.
Last I knew, ties were decided by the internal document id.

you can control this any way you want, just include a Sort
object in your query with multiple SortFields. Two pre-defined
SortFields types you can use are FIELD_SCORE and
FIELD_DOC and you can add any number of other fields to sort by,
see the API for Sort and SortField...

The default is pretty much equivalent to a Sort object with two
SortFields, the two mentioned above...

HTH
Erick

On Sun, Jun 13, 2010 at 9:38 AM, Naama Kraus <na...@gmail.com> wrote:

> Hi All,
>
> I wanted to ask regarding search results scores equality:
> In case two documents get an equal score - how does Lucene "break" equality
> ?
> I.e. by which criteria one document would be ranked before another ? Random
> ? Indexing time ? Anything else ?
> Can I control this one somehow ?
> (I am using Lucene 3).
>
> Thanks for the input,
> Naama
>