lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marvin Humphrey <>
Subject Re: Lucene scoring: Term frequency normalisation
Date Tue, 12 Dec 2006 13:57:44 GMT

On Dec 12, 2006, at 2:23 AM, Karl Koch wrote:
> However, what exactly is the advantage of using sqare root instead  
> of log?

Speaking anecdotally, I wouldn't say there's an advantage.  There's a  
predictable effect: very long documents are rewarded, since the  
damping factor is not as strong.  For most of the engines I've built,  
that hasn't been desirable.

In order to get optimal results for large collections, it's often  
necessary to customize this, by overriding lengthNorm.  IME, for  
searching general content such as random html documents, the body  
field needs a higher damping factor, but more importantly a plateau  
at the top end to prevent very short documents from dominating the  

   public float lengthNorm(String fieldName, int numTerms) {
     numTerms = numTerms < 100 ? 100 : numTerms;
     return (float)(1.0 / Math.sqrt(numTerms));

In contrast, you don't want the plateau for title fields, assuming  
that malignant keyword stuffing isn't an issue.

This stuff is corpus specific, though.

> Is there any scientific reason behind this? Does anybody know a  
> paper about this issue?

Here's one from 1997:

Lee, Chuang, and Seamons: "Document Ranking and the Vector Space Model"

> Is there perhaps another discussion thread in here which I have not  
> seen.

Searching the mail archives for "lengthNorm" will turn up some more.

Marvin Humphrey
Rectangular Research

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

View raw message