On Dec 6, 2007 2:31 PM, java_user_ <[EMAIL PROTECTED]> wrote:
> Thanks for the response Hoss.
>
> The score I receive is from the Explaination object.  The score stays the
> same regardless of how I boost the single term.
>
> The score of the query:
> apple
>
> Is the same as the score of the query:
> apple^3

This boosts apple 3 times in relation to the other query clauses.  If
there are no other query clauses, it's a bit meaningless.

> I am surprised by the result of the test.  Would you expect "apple" and
> "apple^3" to receive the same score?

Lucene does some "weighting" of the query that causes this to happen.

class Query { [...]
  /** Expert: Constructs and initializes a Weight for a top-level query. */
  public Weight weight(Searcher searcher)
    throws IOException {
    Query query = searcher.rewrite(this);
    Weight weight = query.createWeight(searcher);
    float sum = weight.sumOfSquaredWeights();
    float norm = getSimilarity(searcher).queryNorm(sum);
    weight.normalize(norm);
    return weight;
  }

Are you simply curious about this, or is it causing you a problem somehow?

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to