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


PHP SphinxClient::setConnectTimeout方法代码示例

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


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

示例1: setup

 /**
  * do driver instance init
  */
 public function setup()
 {
     $settings = $this->getSettings();
     if (empty($settings)) {
         throw new BoxRouteInstanceException('init driver instance failed: empty settings');
     }
     $curInst = new \SphinxClient();
     $curInst->setServer($settings['sphinxHost'], $settings['sphinxPort']);
     !empty($settings['sphinxConnectTimeout']) && $curInst->setConnectTimeout($settings['sphinxConnectTimeout']);
     $this->instance = $curInst;
     $this->isAvailable = $this->instance ? true : false;
 }
开发者ID:nickfan,项目名称:appbox,代码行数:15,代码来源:SphinxBoxRouteInstanceDriver.php

示例2: fetch

 public function fetch()
 {
     if (!class_exists('SphinxClient')) {
         return false;
     }
     $s = new SphinxClient();
     $s->setServer($this->_sphinxHost, $this->_sphinxPort);
     if (count($this->_arrSearchOutRangeColumnMinMax) > 0) {
         foreach ($this->_arrSearchOutRangeColumnMinMax as $value) {
             $d = explode(',', $value);
             $s->setFilterRange($d[0], $d[1], $d[2], true);
         }
     }
     if (count($this->_arrSearchInRangeColumnMinMax) > 0) {
         foreach ($this->_arrSearchInRangeColumnMinMax as $value) {
             $d = explode(',', $value);
             $s->setFilterRange($d[0], $d[1], $d[2], false);
         }
     }
     $s->setConnectTimeout($this->_connectTimeout);
     $s->setMaxQueryTime($this->{$_maxquerytime});
     //            $s->setRetries ( int $this->retriesCount , int $this->retriesDelay  );
     //
     $s->setMatchMode($this->searchMode);
     $s->setFieldWeights($this->_fieldweights);
     //            $s->setFilter ( string $attribute , array $values [, bool $exclude = false ] );
     //            $s->setFilterFloatRange ( string $attribute , float $min , float $max [, bool $exclude = false ] );
     //            $s->setFilterRange ( string $attribute , int $min , int $max [, bool $exclude = false ] );
     //            $s->setGeoAnchor ( string $attrlat , string $attrlong , float $latitude , float $longitude );
     //            $s->setGroupBy ( string $attribute , int $func [, string $groupsort = "@group desc" ] );
     //            $s->setGroupDistinct ( string $attribute );
     //            $s->setIDRange ( int $min , int $max );
     $s->setIndexWeights($this->_arrIndexweights);
     //            $s->setLimits ( int $offset , int $limit [, int $max_matches = 0 [, int $cutoff = 0 ]] );
     $s->setMatchMode($this->searchMode);
     //            $s->setOverride ( string $attribute , int $type , array $values );
     $s->setRankingMode($this->rankMode);
     //            $s->setSelect ( string $clause );
     //            $s->setSortMode ( int $mode [, string $sortby ] );
     return $s->query($this->_query);
 }
开发者ID:falkbizz,项目名称:SphinxSearchTools,代码行数:41,代码来源:Query.php


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