php-doc-en/reference/sphinx/sphinxclient/setgroupby.xml
2009-11-25 14:49:47 +00:00

102 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="sphinxclient.setgroupby" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>SphinxClient::setGroupBy</refname>
<refpurpose>Set grouping attribute</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>SphinxClient::setGroupBy</methodname>
<methodparam><type>string</type><parameter>attribute</parameter></methodparam>
<methodparam><type>int</type><parameter>func</parameter></methodparam>
<methodparam choice="opt"><type>string</type><parameter>groupsort</parameter><initializer>"@group desc"</initializer></methodparam>
</methodsynopsis>
<para>
Sets grouping attribute, function, and group sorting mode, and enables
grouping.
</para>
<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:
<command>SELECT ... GROUP BY $func($attribute) ORDER BY $groupsort</command>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>attribute</parameter></term>
<listitem>
<para>
A string containing group-by attribute name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>func</parameter></term>
<listitem>
<para>
Constant, which sets a function applied to the attribute value in order
to compute group-by key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>groupsort</parameter></term>
<listitem>
<para>
An optional clause controlling how the groups are sorted.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><xref linkend="sphinxclient.resetgroupby" /></member>
<member><xref linkend="sphinxclient.setsortmode" /></member>
<member><xref linkend="sphinxclient.setgroupdistinct" /></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->