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可以設置在搜索時匹配項的相似度。在項的最后加上符號"^"緊接一個數字(增量值),表示搜索時的相似度。增量值越高,搜索到的項相關度越好。
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:
通過增量一個項可以控制搜索文檔時的相關度。例如如果您要搜索jakarta apache,同時您想讓"jakarta"的相關度更加好,那么在其后加上"^"符號和增量值,也就是您輸入:
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相關度高。您也可以增量短語,象以下這個例子一樣:
"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)
默認情況下,增量值是1。增量值也可以小于1(例如0.2),但必須是有效的。
|