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),但必须是有效的。
|