The method of integrating Xunsearch search engine with YII2 framework

Source: Internet
Author: User
This article mainly introduced the YII2 framework Integration Xunsearch Search engine method, combined with the case form Analysis YII2 Framework integration Xunsearch specific steps and related considerations, accustomed to use Yii2 frame friends can not miss this article Oh!!

This paper describes the method of YII2 framework integrating Xunsearch search engine. Share to everyone for your reference, as follows:

The company has been using the YII2 framework, and then to do a Chinese search engine, all want to xunsearch this project, before an article mentioned, how to install Xunsearch server.

Xunsearch temporarily only Liunx server and PHP-SDK. But the author does provide a YII2 extension. Suddenly feel good happy to say.

It would have been easier to write a simple add index and update index by using PHP-SDK, but also to have the ability to delete an index, but with a multi-item scenario in mind. is a xunsearch can be common to multiple projects, all configuration files are placed in each project's configuration file, according to the project's configuration file to distinguish each search database. This is my first thought, but the point is not how to think, but how to do it. Practice is the hard truth, and then you encounter the following problems.

http://www.yiiframework.com/extension/yii-xunsearch/#hh4 Here the target link, I will next say installation experience

Application Components  ' components ' [    /...    ] Xunsearch ' = = [      ' class ' = ' hightman\xunsearch\connection ',//This line must be, this is not necessarily the case, May be hightman.xunsearch.Connection based on actual project      ' inidirectory ' = ' @app/config ',  //Search INI file directory, default: @vendor/ Hightman/xunsearch/app      ' charset ' = ' utf-8 ',  //Specify the default encoding used by the project, default instant Utf-8, unspecified    ],  

Then, if your PHP environment is an integrated installation package, you may encounter such a problem

Unexpected character in input: ' \ ' (ascii=92) state=1

Online Some people say is php.ini inside the configuration problem, said put, short_open_tag change into on, I first see feel very reasonable, and then find found, originally is on.

Then go to http://stackoverflow.com (a technical forum that the world's technology is using, the official language is English) to find it, sure enough. Know the truth of me, really do not want more.

Because that YII2 extension uses the namespace effects of PHP5.3. And my local PHP version is 5.2.6. I said I couldn't be calm. The thing that tortured the day, incredibly because the PHP version is too low ...

To summarize here.

Similar articles:

YII2 Automatic login cookie always fails to do

Recently do YII2 automatic login function, found that even if the YII2 automatic login configuration feature is turned on, the browser is closed once again ...

Phpexcel Export Excel File method in Yii2 framework

This article mainly introduces the YII2 framework in the use of Phpexcel export Excel file related data, with a certain reference value, sense ...

Yii2 Simple parsing using caching

A framework with a cache can be said to be a good framework. The following small series through this article to introduce you how to use the Yii2 ...

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.