当前位置: 首页>>代码示例>>PHP>>正文


PHP SphinxClient::setGroupBy方法代码示例

本文整理汇总了PHP中SphinxClient::setGroupBy方法的典型用法代码示例。如果您正苦于以下问题:PHP SphinxClient::setGroupBy方法的具体用法?PHP SphinxClient::setGroupBy怎么用?PHP SphinxClient::setGroupBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SphinxClient的用法示例。


在下文中一共展示了SphinxClient::setGroupBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setGroupBy

 /**
  * Group results by an attribute.
  *
  * @param string $attribute The name of the attribute.
  * @param int $func Constant, applied to attribute value, one of the SPH_GROUPBY_ constants.
  * @param string $groupsort An optional clause controlling how the groups are sorted.
  */
 public function setGroupBy($attribute, $func, $groupsort = "@group desc")
 {
     $this->sphinx->setGroupBy($attribute, $func, $groupsort);
 }
开发者ID:headzoo,项目名称:sphinx-search-bundle,代码行数:11,代码来源:SphinxSearch.php

示例2: groupby

 /**
  * @brief set grouping attribute and function, SQL-like syntax - 'group_by'
  * @param array $groupby
  * @return $this chain
  */
 public function groupby($groupby = null)
 {
     $this->criteria->groupby = $groupby;
     // set groupby
     if ($groupby && is_array($groupby)) {
         $this->client->setGroupBy($groupby['field'], $groupby['mode'], $groupby['order']);
     }
     return $this;
 }
开发者ID:zwq,项目名称:unpei,代码行数:14,代码来源:DGSphinxSearch.php

示例3: elseif

 } elseif (!$fids) {
     showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
 }
 if ($_G['adminid'] != '1' && $_G['setting']['search']['forum']['maxspm']) {
     if (DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_searchindex') . " WHERE srchmod='{$srchmod}' AND dateline>'{$_G['timestamp']}'-60") >= $_G['setting']['search']['forum']['maxspm']) {
         showmessage('search_toomany', 'search.php?mod=forum', array('maxspm' => $_G['setting']['search']['forum']['maxspm']));
     }
 }
 if ($srchtype == 'fulltext' && $_G['setting']['sphinxon']) {
     require_once libfile('class/sphinx');
     $s = new SphinxClient();
     $s->setServer($_G['setting']['sphinxhost'], intval($_G['setting']['sphinxport']));
     $s->setMaxQueryTime(intval($_G['setting']['sphinxmaxquerytime']));
     $s->SetRankingMode($_G['setting']['sphinxrank']);
     $s->setLimits(0, intval($_G['setting']['sphinxlimit']), intval($_G['setting']['sphinxlimit']));
     $s->setGroupBy('tid', SPH_GROUPBY_ATTR);
     if ($srchfilter == 'digest') {
         $s->setFilterRange('digest', 1, 3, false);
     }
     if ($srchfilter == 'top') {
         $s->setFilterRange('displayorder', 1, 2, false);
     } else {
         $s->setFilterRange('displayorder', 0, 2, false);
     }
     if (!empty($srchfrom) && empty($srchtxt) && empty($srchuid) && empty($srchuname)) {
         $expiration = TIMESTAMP + $cachelife_time;
         $keywords = '';
         if ($before) {
             $spx_timemix = 0;
             $spx_timemax = TIMESTAMP - $srchfrom;
         } else {
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:search_forum.php

示例4: bindToSphinx

 /**
  * @param \SphinxClient $sphinx
  */
 public function bindToSphinx(\SphinxClient $sphinx)
 {
     $sphinx->setGroupBy($this->getAttr(), $this->getFunc(), $this->getGroupBy());
 }
开发者ID:scorpioframework,项目名称:sphinx-search,代码行数:7,代码来源:GroupBy.php


注:本文中的SphinxClient::setGroupBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。