D
D
DoctorDemon2011-04-14 00:05:17
Sphinx
DoctorDemon, 2011-04-14 00:05:17

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

2 answer(s)
M
MuXaJIbI4, 2011-04-14
@MuXaJIbI4

can just make two queries to the sphinx and merge the results later

S
Shedar, 2011-04-14
@Shedar

In advanced mode, calculate the weight taking into account the base weight and the country, so that for gb the weight is + a lot

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question