Reputation: 307
I'm trying to read document score of lucene search results.
I get a set of document scores through the hits object when I use the following method : Hits hits = IndexSearcher.search(myQuery);
However,if i use the method: searcher.search(myQuery, hitsCollector);
I get a totally different set of document scores through the hitCollector.hits object
Am I missing something here?
Thanks!
Upvotes: 0
Views: 989
Reputation: 2473
The scores returned by a Hits object are normalized, i.e. they are always in the range [0, 1], with the highest score close to or at 1. The scores given to a HitCollector object are raw, i.e. not normalized. Also, the list of documents in a Hits object is sorted by decreasing scores. A HitCollector object gets document-score pairs in some random order.
Upvotes: 2