Hello,
I would to be able to get the score for each a hit returned to use for post processing. Hit.getScore() is deprecated, so is there a way to still do this? Much Googling has turned up nothing.
thanks,
Allasso
Printable View
Hello,
I would to be able to get the score for each a hit returned to use for post processing. Hit.getScore() is deprecated, so is there a way to still do this? Much Googling has turned up nothing.
thanks,
Allasso
Are you talking this related to Java or Apache?
I don't understand your question. I understand Lucene to be an API using Java that is provided by Apache.
Allasso
Sorry about that. I'm not clear with my question. I just want to know that same concept use in php as well. Never mind.
Did you read the API? They have a recommendation for that deprecated method.
Hits (Lucene 2.2.0 API)
reading the 2.9.1 docs, the entire Hits class is deprecated.
I've that 2.2 version and still using it. Didn't they have any suggestion for that in 2.9?
I never found any recommendations, but I finally stumbled on a way to get it:
ScoreDoc.score
the way I got it in my app:
Thank you much, ErangaCode:TopScoreDocCollector collector = TopScoreDocCollector.create(hitsPerPage, true);
ScoreDoc[] hits = collector.topDocs().scoreDocs;
hits[i].score
Allasso
From where you find about this. If you have any related stuff can you send it to me here. If I update my stuff then I have to deal with those as well in near future.
Soooooooooo sorry, Eranga,
After my last post I never came back to the forum, so I didn't see your request. If I remember I didn't find it on a forum or anything, I just started working with TopScoreDocCollector class, trying the methods, looking at the classes of the objects they return, etc, until I finally got it to work.
The irony is, I ended up not using it after all.
Allasso
That's better. So you can mark the thread solved, if you are satisfied with your solution.