You are here

public function SearchApiMultiQueryInterface::sort in Search API Multi-Index Searches 7

Add a sort directive to this search query.

If no sort is manually set, the results will be sorted descending by relevance.

How sorts on index-specific fields are handled may differ between service backends.

Parameters

string $field: The field to sort by. The special fields 'search_api_relevance' (sort by relevance) and 'search_api_id' (sort by item id) may be used.

string $order: The order to sort items in - either 'ASC' or 'DESC'.

Return value

SearchApiMultiQueryInterface The called object.

Throws

SearchApiException If the field is multi-valued or of a fulltext type.

1 method overrides SearchApiMultiQueryInterface::sort()
SearchApiMultiQuery::sort in ./search_api_multi.query.inc
Add a sort directive to this search query.

File

./search_api_multi.query.inc, line 163

Class

SearchApiMultiQueryInterface
Interface representing a search query on multiple Search API indexes.

Code

public function sort($field, $order = 'ASC');