Sort mode
Search results can be sorted using the following pattern:
Sph_sort_relevance mode, sorted in descending order of relevance (best match in front)
Sph_sort_attr_desc mode, arranged in descending order of attributes (the higher the value of the property, the greater the number of rows in front)
SPH_SORT_ATTR_ASC mode, arranged in ascending order of attributes (the smaller the attribute value, the more it is in front)
Sph_sort_time_segments mode, descending by time period (last hour/day/week/month), and then by relevance
sph_sort_extended mode, which combines columns in ascending or descending order in a SQL-like way.
sph_sort_expr mode, sorted by an arithmetic expression
Use attributes to sort//to Fromid in reverse order, note that when you use Setsortmode again the previous sort $sphinx->setsortmode ("Sph_sort_attr_desc", ' Fromid ') will be overwritten;// If you want to use multiple field sorting can use sph_sort_extended mode//@id is the Sphinx built-in keyword, here refers to Emailid, as for why Emailid, think about $sphinx->setsortmode ("SPH _sort_attr_desc ", ' Fromid ASC, toid desc, @id desc ');//Perform search $result = $sphinx->query (' keywords ', ' * ');
PHP Application Sphinx Interface to sort