Answer the question
In order to leave comments, you need to log in
Ranking problem and bm25
There was a following problem. The project uses Sphinx. The search is performed with a postfix asterisk. To increase the rank of documents with an exact match to a query, a pattern like this is used:
@title дом* | @title дом
mysql> SELECT id, weight() FROM catalogue
-> WHERE MATCH('@(title_star) дом') AND subsite_ids IN (110) AND paid_type_index IN (0) AND id IN (859490, 842300)
-> LIMIT 0, 20
-> OPTION index_weights=(catalogue=1), max_matches=10000, ranker=expr('bm25');
+--------+----------+
| id | weight() |
+--------+----------+
| 842300 | 700 |
| 859490 | 669 |
+--------+----------+
2 rows in set (0.00 sec)
mysql> SELECT id, weight() FROM catalogue
-> WHERE MATCH('@(description_star) дом') AND subsite_ids IN (110) AND paid_type_index IN (0) AND id IN (859490, 842300)
-> LIMIT 0, 20
-> OPTION index_weights=(catalogue=1), max_matches=10000, ranker=expr('bm25');
+--------+----------+
| id | weight() |
+--------+----------+
| 842300 | 700 |
| 859490 | 669 |
+--------+----------+
2 rows in set (0.01 sec)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question