I want to know when a term is boosted in lucene query ho开发者_运维技巧w does scores change? I mean what is the scoring algorithm of lucene for scoring documents when query has one or more term that boosted?
You find the complete answer here:
http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/search/Similarity.html
∑ ( tf(t in d) · idf(t)^2 · t.getBoost() · norm(t,d) )
Each term in the query is summed up with
- The term frequency of one query term in a document
- The inverse document frequency to the power of 2 (if appliable, the fieldtype and its attributes are here important)
- The boost thats what you ask
- And the norm for the term t in d (if appliable, can be disabled in the schema)
The easy answer is its multiplicated to the term weight.
精彩评论