Hello,
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);
Float score = hits.score(1)
and scores from hist was from 0-1; 1 was 100% match
I change code to use hit collector
TopDocCollect
HitCollector scores are not normalized to the 0-1 range, they
are "raw". You have to get the maximum score returned and
normalize the raw scores. See TopDocs.getMaxScore
as I remember.
Best
Erick
On Thu, Jan 29, 2009 at 8:21 PM, AlexElba wrote:
>
> Hello,
> I have project which I am trying to s
/ td.getMaxScore();
Uwe
-
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: u...@thetaphi.de
> -Original Message-
> From: AlexElba [mailto:ramal...@yahoo.com]
> Sent: Friday, January 30, 2009 2:22 AM
> To: java-user@lucene.apache.org
> Subject:
: 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
How are you using the score? The fact that you want them back to the
old way implies to me that you are using them for something other than
for sorting the results.
On Jan 29, 2009, at 8:21 PM, AlexElba wrote:
Hello,
I have project which I am trying to switch from lucene 2.3.2 to 2.4
I
AlexElba wrote:
>
> Hello,
> 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);
> Float score = hits.score(1)
>
> and scores from hist was from 0-1; 1 was 100% match
>
> I chan