Using Sphinx 2.0.6, is there a way to have sphinx return a specific order based on the document ID?
For example, say there are 1000 documents all having id 1-1000. But I want to return, in order, ID 999,1000,4,5,2,and so on.
This use case: The positioning is dynamic and needs to be done through Sphinx. The positioning value needs to be as an attribute that can change on-the-fly. This is also paged -- so I can't simply gather the ID Set and request a SQL. Sphinx itself needs to return the specific order I give it.
$cl->setSelect("*,FIND_IN_SET(id,".implode($id_array).") AS id_position");
$cl->SetSortMode(SPH_SORT_EXTENDED, 'id_position DESC');
$cl->setSelect("*,FIELD(id,".implode($id_array).") AS id_position");
$cl->SetSortMode(SPH_SORT_EXTENDED, 'id_position DESC');
Unfortunately, doesn't look like Sphinx supports FIELD() and FIELD_IN_SET().
Any ideas how to complete this task? I'm at a loss right now and could use the help!