Full-text search for coreseek

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.