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 Nada Mimouni <mi...@tk.informatik.tu-darmstadt.de> on 2009/06/18 18:16:49 UTC

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

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

<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 


Re: Same score for different fields

Posted by Otis Gospodnetic <ot...@yahoo.com>.
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 <mi...@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