📄 sphinxclient.setgroupby.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Set grouping attribute</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sphinxclient.setgeoanchor.html">SphinxClient::setGeoAnchor</a></div> <div class="next" style="text-align: right; float: right;"><a href="sphinxclient.setgroupdistinct.html">SphinxClient::setGroupDistinct</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.setgroupby" class="refentry"> <div class="refnamediv"> <h1 class="refname">SphinxClient::setGroupBy</h1> <p class="verinfo">(No version information available, might be only in CVS)</p><p class="refpurpose"><span class="refname">SphinxClient::setGroupBy</span> — <span class="dc-title">Set grouping attribute</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><b><b>SphinxClient::setGroupBy</b></b></span> ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$attribute</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$func</tt></span> [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$groupsort</tt></span> ] )</div> <p class="para rdfs-comment"> Sets grouping attribute, function, and group sorting mode, and enables grouping. </p> <p class="para"> Grouping feature is very similar to GROUP BY clause in SQL. Results produced by this function call are going to be the same as produced by the following pseudo code: <strong class="command">SELECT ... GROUP BY $func($attribute) ORDER BY $groupsort</strong>. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">attribute</tt></i></span> <dd> <p class="para"> A string containing group-by attribute name. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">func</tt></i></span> <dd> <p class="para"> Constant, which sets a function applied to the attribute value in order to compute group-by key. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">groupsort</tt></i></span> <dd> <p class="para"> An optional clause controlling how the groups are sorted. Defaults to "@group desc". </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure. </p> </div> <div class="refsect1 seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"><a href="sphinxclient.resetgroupby.html" class="xref">SphinxClient::resetGroupBy</a></li> <li class="member"><a href="sphinxclient.setsortmode.html" class="xref">SphinxClient::setSortMode</a></li> <li class="member"><a href="sphinxclient.setgroupdistinct.html" class="xref">SphinxClient::setGroupDistinct</a></li> </ul> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="sphinxclient.setgeoanchor.html">SphinxClient::setGeoAnchor</a></div> <div class="next" style="text-align: right; float: right;"><a href="sphinxclient.setgroupdistinct.html">SphinxClient::setGroupDistinct</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -