本文整理汇总了PHP中SphinxClient::SetOverride方法的典型用法代码示例。如果您正苦于以下问题:PHP SphinxClient::SetOverride方法的具体用法?PHP SphinxClient::SetOverride怎么用?PHP SphinxClient::SetOverride使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SphinxClient
的用法示例。
在下文中一共展示了SphinxClient::SetOverride方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SphinxClient
<?php
require "spec/fixtures/sphinxapi.php";
$cl = new SphinxClient();
$cl->SetOverride('attr1', SPH_ATTR_INTEGER, array(10 => 20));
$cl->SetOverride('attr2', SPH_ATTR_FLOAT, array(11 => 30.3));
$cl->SetOverride('attr3', SPH_ATTR_BIGINT, array(12 => '1099511627780'));
$cl->Query('query');
示例2: fopen
fwrite($file, $client->_reqs[$client->AddQuery("test ", "*", "commenting")]);
fclose($file);
// update_simple
$file = fopen("spec/fixtures/data/update_simple.bin", "w");
fwrite($file, $client->UpdateAttributes("people", array("birthday"), array(1 => array(191163600))));
fclose($file);
// keywords_without_hits
$file = fopen("spec/fixtures/data/keywords_without_hits.bin", "w");
fwrite($file, $client->BuildKeywords("pat", "people", false));
fclose($file);
// keywords_with_hits
$file = fopen("spec/fixtures/data/keywords_with_hits.bin", "w");
fwrite($file, $client->BuildKeywords("pat", "people", true));
fclose($file);
// overrides
$client->SetOverride("rating", SPH_ATTR_FLOAT, array(1 => 10.0));
$file = fopen("spec/fixtures/data/overrides.bin", "w");
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
fclose($file);
$client->ResetOverrides();
// select
$client->SetSelect("selecting");
$file = fopen("spec/fixtures/data/select.bin", "w");
fwrite($file, $client->_reqs[$client->AddQuery("test ")]);
fclose($file);
$client->SetSelect("*");
// filter_array
$client->SetFilter("field", array(1, 2, 3));
$file = fopen("spec/fixtures/data/filter_array.bin", "w");
fwrite($file, $client->FilterOutput());
fclose($file);