开发者

SOLR: Boosting based on location of search term in field

I'm building a search engine with SOLR, and when an user searches for a phrase such as "apple", I get results such as:

开发者_JAVA百科

Babyfood, apple ... apple, raw

I want "apple, raw" to appear ahead of "babyfood, apple" because the word apple appears in the front. Is there a way to do this with SOLR? To give more score to those results where the search term appears more in the front?


try q=(field:apple*)^2 OR field:apple

where field is the name of the field against which you are searching

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜