Coreseek full-text search I installed coreseek in windows
In the msdos test, you can search for multiple results,
But when I return to php, I cannot search for the same keywords.
But: English can be found on the php page
This is my PHP code
Require ("sphinxapi. php "); $ cl = new SphinxClient (); $ cl-> SetServer ('2017. 0.0.1 ', 9312); // the following settings are used to return results in array format $ cl-> SetArrayResult (true ); /* // ID filtering $ cl-> SetIDRange (3, 4); // use setFilter to filter attribute fields of the SQL _attr_uint type, similar to SQL where group_id = 2 $ cl-> setFilter ('group _ id', array (2); // SQL _attr_uint and other attribute fields, you can also set the filter range, similar to SQL WHERE group_id2> = 6 AND group_id2 <= 8 $ cl-> SetFilterRange ('group _ id2', 6, 8 ); * /// retrieve the first 20 pieces of data starting from the beginning, is similar to the SQL statement LIMIT $ cl-> SetLimits (); // When indexing, the SQL _attr _ type field is not set. you can use it as a "search string" for full-text search $ res = $ cl-> Query ('Ai ',"*"); // "*" indicates that all indexes are searched at the same time. "index name (for example, test or test, test2) "to search for the specified // If you need to search for the content of the specified full-text field, you can use the extended match mode: # $ cl-> SetMatchMode (SPH_MATCH_EXTENDED ); // $ res = $ cl-> Query ("@ title ('test ')","*"); // $ res = cl-> Query ('@ title (test) @ content ('network')', "*"); echo'';print_r($res['matches']);print_r($res);print_r($cl->GetLastError());print_r($cl->GetLastWarning());echo '
';?>
Reply to discussion (solution)
Character set problems
Msdos is the default operating system character set GBK
Your program uses UTF-8
Character set problems
Msdos is the default operating system character set GBK
Your program uses UTF-8
I used icnov transcoding in msdos, which is equivalent to utf8.