Answer the question
In order to leave comments, you need to log in
Sorting by value in Sphinx
Good day, %username%!
Tell me, how can I sort search results in Sphinx so that first there are results for a certain field value, and then for all other options?
That is, there is a table:
You need to show all topics by relevance, or weight value, and first show the results for the country gb, and only after that for the rest of the countries.
+--------+---------------------+-------------+
| itm_id | itm_ttl | itm_country|
+--------+---------------------+-------------+
| 1565 | asd asd asd asd | ca |
| 1 | Sphinx EN | en |
| 7599 | sphinx CA | ca |
| 777 | sphinx for GB | gb |
| 56 | Soul en | en |
| 57 | soul ca | ca |
| 58 | soul gb | gb |
+--------+---------------------+-------------+
Answer the question
In order to leave comments, you need to log in
can just make two queries to the sphinx and merge the results later
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question