E
E
Evgen2015-06-06 16:23:50
Sphinx
Evgen, 2015-06-06 16:23:50

Why does using min_hit_pos in ranking not give the desired result in sphinx?

I use ranking by expression

$sphinx->SetMatchMode(SPH_MATCH_EXTENDED2);
$sphinx->SetFieldWeights(array('name'      => 100,  'valAuthor' => 20));
$sphinx->SetRankingMode(SPH_RANK_EXPR, "sum((1/(min_hit_pos)+user_weight*IF(exact_hit==1,5000*doc_word_count, 4000*doc_word_count))");
$sphinx->SetSortMode(SPH_SORT_EXPR, "IF(qty, 1, 0.1)*@weight");

In this case, three fields are indexed: name, valAuthor, qty, where, respectively, the name, author, number of books.
In this case, for example, if I enter "Rome", then
"Forensics" is ranked higher than "Rome: Guide".
If you calculate the logic, it turns out:
forensics: 0.25 + 100 * 4000 * 1 + 20 * 0 = 400000.25
Rome: guide: 1 + 100 * 4000 * 1 + 20 * 0 = 400001
qty and there, and there more 0.
At the same time, I understand that Rome: the guide should rank higher, but this does not happen.
Correct me, where am I messing up?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2015-06-07
@opium

Remove your ranking and search for Rome and then gradually add your ranking

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question