Sphinx 0.9.9 has been configured to work with MySql.
I recently notice that Sphinx do not work for search terms that contain any multiple occurrence of < or > characters.
The working PHP code :
// Initialize SphinxClient class object
$cl = new SphinxClient ();
// Set the server and port
$cl->SetServer ( "127.0.0.1", 9313 );
// Initialize prefixed query
$query_prefix = '';
// Set the limit
$cl->SetLimits((int)$offset, (int)$count);
// Set the match mode
$cl->setMatchMode(SPH_MATCH_EXTENDED);
// Set the ranking mode
$cl->setRankingMode(SPH_RANK_WORDCOUNT);
// Set sorting
$cl->SetSortMode(SPH_SORT_EXTENDED,'@relevance DESC, updated_date DESC' );
$query_main = '@(name,description)';
// Initialize the search index
$search_index = 'index_common';
$search_text = $cl->EscapeString($search_text);
// Run the search query
$resp = $cl->Query($query_prefix . '('. $query_main . '"^' . $search_text . '$" | "' .
$search_text . '" | (' . $search_text . ') | "'
. $search_text . '"/1 | (' . $search_text_wild . ')) ' ,$search_index);
If I enter a search term like ">>" without quote it generates the query below :
(@(name,description)"^>>$" | ">>" | (>>) | ">>"/1 | (*>>*))
And does not give any response like when a search term is not found in the system. This happened for multiple occurrences of < and > not for single.
Is this a known issue in the Sphinx or is there a way to overcome (to make Sphinx works normal for these kind of special cases) ?
<< is used as strict order operator - I think there is also unofficial >> syntax.
So that probably causes issues. You could try escaping them, I guess EscapeString doesnt do them.
But remember, that unless < and > are in your charset table they will never be able to match anyway.
(Also when you say you get no responce, be sure to check $cl->getLastError()
!!