I use SphinxSearch to query for some content and have the identifiers of my objects that I want to query with MySQL. The array of my identifiers is sorted based on their Sphinx rank. Thus, I would like to make MySQL as follows:
SELECT * FROM table WHERE id IN (1,17,2) ORDER BY FIELD(id,1,17,2)
I know that I can:
Table::whereIn('id', $ids)->get();
But I canβt get the order I had.
How can I do this with Laravel?
php mysql laravel sphinx
MPikkle
source share