Shahryar
Shahryar

Reputation: 1474

boosting a term in lucene's query

I want to know when a term is boosted in lucene query how does scores change? I mean what is the scoring algorithm of lucene for scoring documents when query has one or more term that boosted?

Upvotes: 0

Views: 833

Answers (1)

fyr
fyr

Reputation: 20869

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.

Upvotes: 3

Related Questions