I use this library which basically is just a query builder.
The following query:
SELECT * FROM car_search ORDER BY car_model_name ASC, car_id DESC LIMIT 2;
Resulting in:
+------+----------------+---------------------+
| id | car_model_name | car_id |
+------+----------------+---------------------+
| 33 | Audi | 17461 |
| 20 | Bentley | 17439 |
+------+----------------+---------------------+
Now if I alter the query orders such as,
SELECT * FROM car_search ORDER BY car_model_name ASC, car_id ASC LIMIT 2;
As can be seen, I changed the order from car_id DESC
to car_id ASC
in hope that the result would be ordered pretty much like how MySQL would. It's like Sphinx is ignoring the orders queries except for the first one.
But the returned result is exactly the same for both queries.
I've read about sorting modes in Sphinx doc, but it seems that it's only can be done if I were to use PHP sphinx client.
Is there anyway to have it written on index configuration instead, perhaps such as min_prefix_len
, enable_star
, etc?
Or directly from the query?