本文整理汇总了PHP中SphinxClient::Status方法的典型用法代码示例。如果您正苦于以下问题:PHP SphinxClient::Status方法的具体用法?PHP SphinxClient::Status怎么用?PHP SphinxClient::Status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SphinxClient
的用法示例。
在下文中一共展示了SphinxClient::Status方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_sugg_trigrams
private function get_sugg_trigrams($word, SearchEngineOptions $options)
{
$trigrams = $this->BuildTrigrams($word);
$query = "\"{$trigrams}\"/1";
$len = strlen($word);
$this->resetSphinx();
$this->suggestionClient->SetMatchMode(SPH_MATCH_EXTENDED2);
$this->suggestionClient->SetRankingMode(SPH_RANK_WORDCOUNT);
$this->suggestionClient->SetFilterRange("len", $len - 2, $len + 4);
$this->suggestionClient->SetSortMode(SPH_SORT_EXTENDED, "@weight DESC");
$this->suggestionClient->SetLimits(0, 10);
$indexes = [];
foreach ($options->getDataboxes() as $databox) {
$indexes[] = 'suggest' . $this->CRCdatabox($databox);
}
$index = implode(',', $indexes);
$res = $this->suggestionClient->Query($query, $index);
if ($this->suggestionClient->Status() === false) {
return [];
}
if (!$res || !isset($res["matches"])) {
return [];
}
$words = [];
foreach ($res["matches"] as $match) {
$words[] = $match['attrs']['keyword'];
}
return $words;
}
示例2: CheckSphinxRunning
public function CheckSphinxRunning()
{
$SphinxSearchModel = new SphinxClient();
///@todo fix this from getting new instance of sphinxclient
$Status = $SphinxSearchModel->Status();
//will return an array of misc info if sphinx is running
if (!empty($Status)) {
parent::Update(SS_SUCCESS, 'SearchdRunning', TRUE);
//save as running
return $Status;
//yes, it is
} else {
parent::Update(SS_SUCCESS, 'SearchdRunning', FALSE);
//save as not running
return FALSE;
//not running
}
}