Reputation: 2264
I'm trying to understanding what kind of score does lucene performs during searching? I see Lucene TermVector contains bunch of statistics, when I search for a term, how the score is calculated in query time?
Does TermVector and its statistics used during searching? if so how ?
Upvotes: 0
Views: 699
Reputation: 6131
The Similarity class is responsible for scoring documents.
A Collector iterates over documents. It is used in conjunction with a Scorer to assign scores and to rank documents by those scores. A Scorer instance calculates scores under specific conditions. There are more than a dozen different kinds of scorers. For example, a TermScorer calculates the raw score as follows:
getSimilarity().tf(f)*weightValue
The weight value is derived from the query. If normalization is turned on at index time (so that scores between queries are more or less comparable), the normalization is applied after this. Normalization factors are pre-computed and cached.
Upvotes: 1