Lucene provides the relevance level of matching documents based on the terms found. To boost a term use the caret, "^", symbol with a boost factor (a number) at the end of the term you are searching. The higher the boost factor, the more relevant the term will be.
Lucene可以設(shè)置在搜索時(shí)匹配項(xiàng)的相似度。在項(xiàng)的最后加上符號(hào)"^"緊接一個(gè)數(shù)字(增量值),表示搜索時(shí)的相似度。增量值越高,搜索到的項(xiàng)相關(guān)度越好。
Boosting allows you to control the relevance of a document by boosting its term. For example, if you are searching for jakarta apache and you want the term "jakarta" to be more relevant boost it using the ^ symbol along with the boost factor next to the term. You would type:
通過(guò)增量一個(gè)項(xiàng)可以控制搜索文檔時(shí)的相關(guān)度。例如如果您要搜索jakarta apache,同時(shí)您想讓"jakarta"的相關(guān)度更加好,那么在其后加上"^"符號(hào)和增量值,也就是您輸入:
jakarta^4 apache
This will make documents with the term jakarta appear more relevant. You can also boost Phrase Terms as in the example:
這將使得生成的doucment盡可能與jakarta相關(guān)度高。您也可以增量短語(yǔ),象以下這個(gè)例子一樣:
"jakarta apache"^4 "jakarta lucene"
By default, the boost factor is 1. Although, the boost factor must be positive, it can be less than 1 (i.e. .2)
默認(rèn)情況下,增量值是1。增量值也可以小于1(例如0.2),但必須是有效的。
|