Make sure to review the "similarity" javadoc page to understand what any of these factors does to the document score.

See:
http://lucene.apache.org/core/3_6_0/api/all/org/apache/lucene/search/Similarity.html

Sure, a document boost applies a multiplicative factor, but that is all relative to all of the other factors for that document and query. In other words, "all other things being equal", a doc-boost of 2.0 would double the score, but all other things are usually not equal.

Try different doc-boost values and see how the score is affected. The document may have such a low score that a boost of 2.0 doesn't move the needle relative to other documents.

I believe that the doc-boost is included within the "fieldNorm" value that is shown in the "explain" section if you add &debugQuery=true to your query request. This is explained under "norm" in the similarity javadoc.

I did try a couple of examples with the Solr 3.6 example, such as doc boost=2.0, 0.2 (de-boost), 4.0, and 8.0. In my case, it took a boost of 8.0 to move a document up.

-- Jack Krupansky

-----Original Message----- From: Danilak Michal
Sent: Wednesday, July 04, 2012 10:57 AM
To: solr-user@lucene.apache.org
Subject: Boosting the score of the whole documents

Hi guys,
I have the following problem.

I would like to give a boost to the whole documents as I index them. I am
sending to solr the xml in the form:

<add><doc boost="2.0">....</doc></add>

But it does't seem to alter the search scores in any way. I would expect
that to multiply the final search score by two, am I correct?
Probably I would need to alter schema.xml, but I found only information on
how to do that for specific fields (just put omitNorms=false into the field
tag). But what should I do, if I want to boost the whole document?

Note: by boosting a whole document I mean, that if document A has search
score 10.0 and document B has search score 15.0 and I give document A the
boost 2.0, when I index it, I would expect its search score to be 20.0.

Thanks in advance!

Reply via email to