SetOverride() public method

$values must be a hash that maps document IDs to attribute values
public SetOverride ( $attrname, $attrtype, $values )
Esempio n. 1
0
<?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');
Esempio n. 2
0
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);