开发者

Lucene / Lucene.NET - Document.SetBoost() values?

开发者 https://www.devze.com 2022-12-08 11:23 出处:网络
I know it takes in a float, but what are some typ开发者_C百科ical values for various levels of boosting within a result?

I know it takes in a float, but what are some typ开发者_C百科ical values for various levels of boosting within a result?

For example:

If I wanted to boost a document's weighting by 10% then I should set it 1.1? For 20% then 1.2?

What happens if I start setting boosts to values like 75.0? or 500.0?

Edit: Fixed Formatting


Please see the Lucene Similarity Documentation for the formula. In principle, all other factors being equal, setting a document's boost to 1.1 will indeed give it a score that is 10% higher as compared to an identical document with a boost of 1.0. If you have a set of documents that should be intrinsically preferred in searches, this may be a good idea. Note that document boost is an indexing-time attribute, making it impossible to change the document's boost without reindexing it. There are other important factors in scoring - including term match scores, norms etc. See Debugging Relevance Issues in Search for details.


Adding to what Yuval has said. This value is function of field boost & document boost. The boost values are encoded in a single byte. So, the precision might be lost while storing this value. Debugging with Searcher.Explain() would help you get the right amount of boost.

If you want the boost value to be preserved (it's useful, for example, when you want to recreate index from current index), you may add it in a stored field.


The important thing to remember about boosting is not to approach it in isolation, you need to consider it as part of a global strategy, make a list of each criteria used to effect the relevancy and then order those criteria. Define a relationship between each of those criteria. Are you regularly re-indexing or are you just adding new documents, if you are regularly re-indexing, you can afford to tune your document boost criteria, if not you need to think it through thoroughly beforehand.

0

精彩评论

暂无评论...
验证码 换一张
取 消