fclose($file); $client->ResetGroupBy(); // distinct $client->SetGroupDistinct("id"); $file = fopen("spec/fixtures/data/distinct.bin", "w"); fwrite($file, $client->_reqs[$client->AddQuery("test ")]); fclose($file); $client->ResetGroupBy(); // weights $client->SetWeights(array(100, 1)); $file = fopen("spec/fixtures/data/weights.bin", "w"); fwrite($file, $client->_reqs[$client->AddQuery("test ")]); fclose($file); $client->SetWeights(array()); // anchor $client->SetGeoAnchor("latitude", "longitude", 10.0, 95.0); $file = fopen("spec/fixtures/data/anchor.bin", "w"); fwrite($file, $client->_reqs[$client->AddQuery("test ")]); fclose($file); $client->ResetFilters(); // rank_mode $client->SetRankingMode(SPH_RANK_WORDCOUNT); $file = fopen("spec/fixtures/data/rank_mode.bin", "w"); fwrite($file, $client->_reqs[$client->AddQuery("test ")]); fclose($file); $client->SetRankingMode(SPH_RANK_PROXIMITY_BM25); // index_weights $client->SetIndexWeights(array("people" => 101)); $file = fopen("spec/fixtures/data/index_weights.bin", "w"); fwrite($file, $client->_reqs[$client->AddQuery("test ")]); fclose($file);
public function setGeoAnchor($attrlat, $attrlong, $lat, $long) { $this->sphinx->SetGeoAnchor($attrlat, $attrlong, $lat, $long); }
function setGeoAnchor($attrlat, $attrlong, $lat = null, $long = null) { $this->sphinx->SetGeoAnchor($attrlat, $attrlong, $lat, $long); return $this; }
<?php require "spec/fixtures/sphinxapi.php"; $cl = new SphinxClient(); $cl->SetGeoAnchor('attrlat', 'attrlong', 20.3, 40.7); $cl->Query('query');