Answer the question
In order to leave comments, you need to log in
How to do a search on a specific field using php sphinxapi?
When running from the console, the where match('@category_id 42') query returns matches on the category_id field.
Through my code:
$cl = new SphinxClient();
$cl->SetServer(SLAVE_HOST, 9312);
$cl->_limit = 300000;
$cl->SetLimits(0, 10000, 10000);
$cl->setMatchMode(SPH_MATCH_EXTENDED2);
$keyword = '@category_id 42';
$keyword = $cl->EscapeString($keyword);
$result = $cl->Query($keyword, 'customers');
Answer the question
In order to leave comments, you need to log in
In general, the answer is found the problem is in this line
. It escaped the @ sign and the request was not read correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question