FAQ
Hi,



I have created a Lucene index with two fields.

Let's take this example entry from my index as displayed by Luke:



Field | Norm | Value

--------------------------------------------

<term> | 0.375 | average

<term> | 0.375 | salary

<term> | 0.375 | professional

<term> | 0.375 | baseball

<term> | 0.375 | player

<term> | 0.375 | of

<seq> | 0.625 | average salary

<seq> | 0.625 | baseball player



When I run the search, documents that contain hits of the field with
the highest norm (or score : is it the same?), in this case the field
"seq", are ranked in the top.

How can I give similar scores for both fields?



Thank you.

Nada

Search Discussions

  • Otis Gospodnetic at Jun 18, 2009 at 5:14 pm
    Nada,

    Scores and norms are two different things. If you look for the Lucene class called DefaultSimilarity you will see how norms are computed:

    public float computeNorm(String field, FieldInvertState state) {
    final int numTerms;
    if (discountOverlaps)
    numTerms = state.getLength() - state.getNumOverlap();
    else
    numTerms = state.getLength();
    return (float) (state.getBoost() * lengthNorm(field, numTerms));
    }


    So that's how two different fields can still have the same norms value.

    Otis
    --
    Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch


    ----- Original Message ----
    From: Nada Mimouni <mimouni@tk.informatik.tu-darmstadt.de>
    To: java-user@lucene.apache.org
    Sent: Thursday, June 18, 2009 12:16:49 PM
    Subject: Same score for different fields

    Hi,



    I have created a Lucene index with two fields.

    Let's take this example entry from my index as displayed by Luke:



    Field | Norm | Value

    --------------------------------------------
    0.375 | average
    0.375 | salary
    0.375 | professional
    0.375 | baseball
    0.375 | player
    0.375 | of
    0.625 | average salary
    0.625 | baseball player


    When I run the search, documents that contain hits of the field with
    the highest norm (or score : is it the same?), in this case the field
    "seq", are ranked in the top.

    How can I give similar scores for both fields?



    Thank you.

    Nada

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-user @
categorieslucene
postedJun 18, '09 at 4:17p
activeJun 18, '09 at 5:14p
posts2
users2
websitelucene.apache.org

2 users in discussion

Nada Mimouni: 1 post Otis Gospodnetic: 1 post

People

Translate

site design / logo © 2022 Grokbase