Hello!
Another problem when setting up Sphinx.
If you enter the search word - the search seems to work somehow. But if you only select filters, the result is empty.
If nothing is entered at all - an error:
fullscan requires extern docinfo PHP:
require_once('/usr/share/sphinx/api/sphinxapi.php');//Include the Sphinx PHP API $cl = new SphinxClient();//Start the SphinxClient class $cl->SetMatchMode(SPH_MATCH_EXTENDED2);//Match all words or any word? $cl->SetSortMode(SPH_SORT_RELEVANCE);// $cl->setLimits(0,10);//Works like MySQL LIMIT $searchWord = "*"; if(!empty($_POST['searchData'])) { $searchWord = trim($_POST['searchData']); } // slider salary //$firePHP -> log($boo); if(!empty($_POST['min_salary'])){ $min_salary = (int)$_POST['min_salary']; $max_salary = (int)$_POST['max_salary']; $exclude = false; $cl->SetFilterRange('salary', $min_salary, $max_salary, $exclude); } // filter select city [] if(!empty($_POST['cities'])) { $city = $_POST['cities']; $exclude = false; $cl->SetFilter('city', $city, $exclude); } Sphinx config:
sql_query = \ SELECT id, occupation, experience, education, branch, typeVacancy, salary, description, city, employer\ FROM vacancy_view sql_attr_uint = salary sql_attr_uint = city