lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maik Schreiber">
Subject AW: Using lucene more effectively
Date Sun, 28 Oct 2001 00:21:40 GMT

>I've read the FAQ on generating the "stars" but am still a bit 
>confused. For example, searching a 2 page document that has 
>about 7 or 8 'email' in it the score is 0.07. Now I would've 
>thought that this is a 4 star at least (if not a 5) kind of 
>search. In fact, I rarely get a 0.8+ score. I am aware that 
>teh score depends on the total number of words as well and 
>that makes it even more confusing on how to design a 
>'starring' strategy.

One way to have more meaningful "stars" would be to use a scale factor
that will be applied to the scores before you decide how many stars to

As an example, all scores could be scaled such that the document with
the highest score will get 100% (and thus gets 5 stars):

	float scaleFactor = hits.score(0);
	float currentDocumentScore;

	while (i = 0; i < hits.length(); i++)
		currentDocumentScore = hits.score(i) * scaleFactor;

		// calculate number of "stars" here

		// do something with hits.doc(i)

Maik Schreiber
IQ Computing -

View raw message