You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Chris Hostetter <ho...@fucit.org> on 2009/02/03 23:47:34 UTC

RE: Lunene 2.3-2.4 switch: Scoring change

: To get the normalized scores use:
	...
: float score = hits[1].score / td.getMaxScore();

Strictly speaking, this code will not return the exact same scores as the 
deprecated Hits API.  the Hits class only normalizes the scores if the max 
score is greater then 1.0f

(yet another one of the marvolously unexpected and hard to explain nuances 
of Hits that make me happy to say goodbye to it)

: > I have project which I am trying to switch from lucene 2.3.2 to 2.4 I am
: > getting some strange scores
: > 
: > Before my code was:
: > 
: > Hits hits= searcher.search(query);
	...




-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org