I am using the sphinx search engine. I need it to search for exact words in a field. Generally it works fine, but there are some weird anomalies.
$this->sphinxclient->Query('@title "Alfa Romeo 159"~3', "indexads" );
I try this. If I correctly understand this searches the field title and the margin between the words cannot be bigger as 2. I user the extended syntax of Sphinx.
$this->sphinxclient->SetArrayResult(true);
$this->sphinxclient->SetMatchMode(SPH_MATCH_EXTENDED2);
$this->sphinxclient->SetSortMode (SPH_SORT_RELEVANCE);
if($category_id>0)
$this->sphinxclient->SetFilter('category', array($category_id));
$this->sphinxclient->SetFilter('status', array(1));
$this->sphinxclient->SetLimits(0,50000);
$this->sphinxclient->setFieldWeights(array ("title"=>1000,"description"=>0));
This is the code that I use to setup the search. Let me just says the filter does absolutely not affect the results I want. I use the extended syntax, because SPH_MATCH_PHRASE doesnt not work the way it is described at all. The extended syntax in generally doesnt work so bad. But the search doesnt return all the results that should match this query. Has anyone else ever withnessed anomalies with the search engine or am I doing something wrong. It is weird because I have two fields that are almost the same but it returns just one.
Alfa Romeo, 159 SportWagon, 1.9 JTDM Distinctive
Alfa Romeo, 159, SW Progression 1.9JTDm
This our two values of the field title, I think both should match the Query yet only the first one does.
Also when I search for something like Audi A8 I always get strings like Audi A6, Audi A4 also returned.