在线文档教程
PHP

SphinxClient::setSortMode

SphinxClient::setSortMode

(PECL sphinx >= 0.1.0)

SphinxClient::setSortMode — Set matches sorting mode

Description

public bool SphinxClient::setSortMode ( int $mode [, string $sortby ] )

Sets matches sorting mode. See available modes below.

ConstantDescription
SPH_SORT_RELEVANCESort by relevance in descending order (best matches first).
SPH_SORT_ATTR_DESCSort by an attribute in descending order (bigger attribute values first).
SPH_SORT_ATTR_ASCSort by an attribute in ascending order (smaller attribute values first).
SPH_SORT_TIME_SEGMENTSSort by time segments (last hour/day/week/month) in descending order, and then by relevance in descending order.
SPH_SORT_EXTENDEDSort by SQL-like combination of columns in ASC/DESC order.
SPH_SORT_EXPRSort by an arithmetic expression.

Parameters

mode

Sorting mode.

sortby

Return Values

Returns TRUE on success or FALSE on failure.

See Also

  • SphinxClient::setMatchMode

  • SphinxClient::setSortMode

← SphinxClient::setServer

SphinxClient::status →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/sphinxclient.setsortmode.php