-
Book Overview & Buying
-
Table Of Contents
Sphinx Search Beginner's Guide
By :
At times you might want to sort the results by values other than relevance. The Sphinx API provides SetSortMode($mode, $sortby="") method which can be used to set the sort mode other than relevance, which is the default sort mode.
The following sorting modes are available in Sphinx:
SPH_SORT_RELEVANCE: Sorts by relevance in descending order, that is, best matches first
SPH_SORT_ATTR_DESC: Sorts by an attribute in descending order, that is, bigger attribute values first
SPH_SORT_ATTR_ASC: Same as SPH_SORT_ATTR_DESC, but sorts in ascending order
SPH_SORT_TIME_SEGMENTS: Sorts by time segments (last hour/day/week/month), in descending order, and then by relevance in descending order
SPH_SORT_EXTENDED: Sorts by SQL-like combination in ASC or DESC order
SPH_SORT_EXPR: Sorts by an arithmetic expression
Examples:
// Sort by relevance. Second parameter is not required in this case. $client->SetSortMode(SPH_SORT_RELEVANCE); // Sort by author_id in descending order $client->...
Change the font size
Change margin width
Change background colour