<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set matches sorting mode</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sphinxclient.setserver.html">SphinxClient::setServer</a></div> <div class="next" style="text-align: right; float: right;"><a href="sphinxclient.status.html">SphinxClient::status</a></div> <div class="up"><a href="class.sphinxclient.html">SphinxClient</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="sphinxclient.setsortmode" class="refentry"> <div class="refnamediv"> <h1 class="refname">SphinxClient::setSortMode</h1> <p class="verinfo">(PECL sphinx >= 0.1.0)</p><p class="refpurpose"><span class="refname">SphinxClient::setSortMode</span> — <span class="dc-title">Set matches sorting mode</span></p> </div> <div class="refsect1 description" id="refsect1-sphinxclient.setsortmode-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>SphinxClient::setSortMode</strong></span> ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$mode</code></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$sortby</code></span> ] )</div> <p class="para rdfs-comment"> Sets matches sorting mode. See available modes below. <table class="doctable table"> <caption><strong>Sorting modes</strong></caption> <thead> <tr> <th>Constant</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>SPH_SORT_RELEVANCE</td> <td>Sort by relevance in descending order (best matches first).</td> </tr> <tr> <td>SPH_SORT_ATTR_DESC</td> <td>Sort by an attribute in descending order (bigger attribute values first).</td> </tr> <tr> <td>SPH_SORT_ATTR_ASC</td> <td>Sort by an attribute in ascending order (smaller attribute values first).</td> </tr> <tr> <td>SPH_SORT_TIME_SEGMENTS</td> <td>Sort by time segments (last hour/day/week/month) in descending order, and then by relevance in descending order.</td> </tr> <tr> <td>SPH_SORT_EXTENDED</td> <td>Sort by SQL-like combination of columns in ASC/DESC order.</td> </tr> <tr> <td>SPH_SORT_EXPR</td> <td>Sort by an arithmetic expression.</td> </tr> </tbody> </table> </p> </div> <div class="refsect1 parameters" id="refsect1-sphinxclient.setsortmode-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">mode</code></em></span> <dd> <p class="para"> Sorting mode. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">sortby</code></em></span> <dd> <p class="para"> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-sphinxclient.setsortmode-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 seealso" id="refsect1-sphinxclient.setsortmode-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="sphinxclient.setmatchmode.html" class="xref">SphinxClient::setMatchMode</a></li> <li class="member"><a href="sphinxclient.setsortmode.html" class="xref">SphinxClient::setSortMode</a></li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sphinxclient.setserver.html">SphinxClient::setServer</a></div> <div class="next" style="text-align: right; float: right;"><a href="sphinxclient.status.html">SphinxClient::status</a></div> <div class="up"><a href="class.sphinxclient.html">SphinxClient</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>