FAQ
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

Search Discussions

  • Erick Erickson at Jun 13, 2010 at 3:54 pm
    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 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
  • Naama Kraus at Jun 13, 2010 at 3:59 pm
    Thanks a lot, this is very helpful !
    Naama
    On Sun, Jun 13, 2010 at 5:05 PM, Erick Erickson 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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 13, '10 at 1:39p
activeJun 13, '10 at 3:59p
posts3
users2
websitelucene.apache.org

2 users in discussion

Naama Kraus: 2 posts Erick Erickson: 1 post

People

Translate

site design / logo © 2022 Grokbase