lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <>
Subject Re: Lucene Scoring
Date Mon, 05 Jul 2010 14:16:04 GMT

On Jul 5, 2010, at 5:02 AM, manjula wijewickrema wrote:

> Hi,
> In my application, I input only single term query (at one time) and get back
> the corresponding scorings for those queries. But I am little struggling of
> understanding Lucene scoring. I have reffered
> and
> some other pages to resolve my matters. But some are still remain.
> 1) Why it has taken the squareroot of frequency as the tf value and square
> of the idf vale in score function?

Somewhat arbitrary, I suppose, but I think someone way back did some tests and decided it
performed "best" in general.  More importantly, the point of the Similarity class is you can
override these if you desire.

> 2) If I enter single term query, then what will return bythe coord(q,d)?
> Since there are always one term in the query, I think always it should be 1!
> Am I correct?

Should be.  You can run the explain() method to confirm.

> 3) I am also struggling understanding sumOfSquaredWeights (in queryNorm(q)).
> As I can understand, this value depends on the nature of the query we input
> and depends on that, it uses different methods such as TermQuery,
> MultiTermQuery, BooleanQuery, WildcardQuery, PhraseQuery, PrefixQuery, etc.
> But if I always use single term query, then what will be the way selected by
> the system from above?

The queryNorm is an attempt at making scores comparable across queries.  Again, I'd try the
explain() method to see the practical aspects of how it effects score.

See for more info on scoring.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message