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
精彩评论