i am new to Sphinx .
<?php
include('sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer('localhost',9312);
//$cl->SetMatchMode(SPH_MATCH_ANY);
//$cl->SetMatchMode(SPH_MATCH_EXTENDED2);
//$cl->SetMatchMode(SPH_MATCH_ALL);
$cl->SetMatchMode(SPH_MATCH_PHRASE);
$cl->SetArrayResult(true);
$cl->SetLimits(0, 100);
$result = $cl->Query("&name one boy","abc_index");
echo "&开发者_运维知识库lt;pre>";
print_r($result);
exit;
?>
i need only "one boy
" word matching records which match mode is correct for that?
i am already using SPH_MATCH_PHRASE
mode. But it is not working?
<?php
include('sphinxapi.php');
$cl = new SphinxClient();
$cl->SetServer('localhost',9312);
$cl->SetMatchMode(SPH_MATCH_EXTENDED2);
$cl->SetArrayResult(true);
$cl->SetLimits(0, 100);
//this is for perfect match mode
$searchkey='one boy';
$sphinxQry = '@(name) '. '"'.$searchkey.'"';
$result = $cl->Query($sphinxQry,"abc_index");
echo "<pre>";
print_r($result);
exit; ?>
精彩评论