lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dragan Jotanovic" <>
Subject RE: Sorting in lucene through Document boosting
Date Mon, 15 Sep 2008 12:08:39 GMT
Thanks Chris.

I made simple Similarity implementation:

	public float lengthNorm(String arg0, int arg1) {
		return 1f;

	public float tf(float arg0) {
		return 1f;

My boost values are calculated simply by calling: 

It works perfectly. I just need to check if I gain something with this,
in terms of performance and resource consumption.

-----Original Message-----
From: Chris Hostetter [] 
Sent: Saturday, September 13, 2008 11:59 PM
Subject: Re: Sorting in lucene through Document boosting

: I thought of setting boost value for documents at index time, with the
: value of my sort field, and then making custom Similarity class which
: would disregard Lucene scoring and take in evaluation only this
: boost.

the general idea should work, but a few things to pay attention to...

1) document boosts are folded into the fieldNorm, so make sure you don't

2) your lengthNorm function needs to return a constant

3) you'll need to adjust your boost values so that when the fieldNorms
converted to the internal 'byte' representation they are still unique
with some simple experimentation you can find an approach that helps you

genreate a mapping from 1,2,3,4,5... to a,b,c,d,... where a<b<c<....


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

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

View raw message