php - search for a phrase in Sphinx -


i'm not able search phrase in sphinx 2.2.9 using extended syntax. in php, example, i'd use code sounds this:

<?php     require ("sphinxapi.php");     $cl = new sphinxclient ();     $cl->setserver("127.0.0.1", 9312);     // $cl->setmatchmode (sph_match_phrase); can't use! deprecated in version 2.2.9     $morethanaword = "to or not be";      // smart code...      echo "ok, in " . $docs . " docs phrase " . $morethanaword . " present " . $hits . "times.";      ?> 

$res = $cl->query("\"$morethanaword\"", 'index_name'); $docs = $res['total_found']; 

can't $hits. sphinx doesnt tell how many times phrase occurs (in cases in document multiple times) - number of matching documents.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -