0
votes

I have installed sphinx on my server, indexed it and running query successfully. I am using sphinxrt code from https://github.com/andrew-s/codeigniter-sphinxrt to search but, it always give me the search for exact phrase. I am not able to search as we do in the sql like query.I have also build the search in php file with the Sphinxql foolz code and that was working perfectly giving me the result as we have in like. I just want same result in the codeigniter also.

1
please share the actual code you running. - barryhunter
$result = $this->sphinxrt->search('people', array('search' => 'john', 'limit' => 100, 'start' => 0 )); This what i am using for searching. - HKumar
If you are searching for a single word 'john' how are you getting match for phrase? Thats not a phrase? Think you need to explain more exactly what your problem actully is. - barryhunter
My problem was that to get record with the name "John Leo" in the search result, I have to give complete name "John" in the search box, where the name should be populate when i type "joh" - HKumar

1 Answers

0
votes

I check the code in the library for sphinxrt. You will find a function named as _escape($string), just modify the return value as return '\'^' . (string)$string . '*\'' then it will search wild card for any value start or end with the keyword.