Answer the question
In order to leave comments, you need to log in
Bring exact matches in Sphiinx search to first place?
Good afternoon,
let's say we are looking for the phrase "history of the city."
There is a section of the site, which is called "History of the city", i.e. full match to the field value.
And there is a section of the site that has a lot of words “history” and “city” in its content in various variations.
Sphinx ranks this second section higher than the first. In principle, I understand it - there are a lot of matches, but I need sections with a 100% match of the field with the request to be displayed from the very beginning.
How can this be implemented?
Solution:
use this ranking option:
$sphinxSearch->setRankingMode(SPH_RANK_EXPR, 'sum((4*lcs+2*(min_hit_pos==1)+exact_hit*100)*user_weight)*1000+bm25');
Answer the question
In order to leave comments, you need to log in
I think sphinxsearch.com/docs/2.1.2/weighting.html will help
you
In particular SPH_RANK_EXPR
sphinxsearch.com/docs/current.html#conf-index-exact-words
sphinxsearch.com/docs/current.html#conf-expand-keywords
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question