Simple tutorial for PHP full-text search function quickly under innodb Engine [xunsearch-based ],
This example describes how to quickly create a full-text search function for PHP under the innodb engine. We will share this with you for your reference. The details are as follows:
Devices to be prepared: Liunx (Centos) Operating System (Linux only) and PHP environment.
Here we will introduce an open-source search engine project developed by Chinese people, called xunsearch, which can be divided into index servers and search servers.
Pleasant server creation in CentOS
wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2tar -xjf xunsearch-full-latest.tar.bz2
Ready to install
Cd xunsearch-full-1.3.0/sh setup. sh // here you can encounter problems with installation failure because gcc-c ++ is not installed. It is very easy to install with yum
During installation, enter the installation directory. Generally, press/usr/local/xunsearch and then press Y to enter the installation directory ..
Wait until the installation is complete.
After the installation is complete, how can I access the service across servers:
Installation Directory (/usr/local/xunsearch/) + bin/xs-ctl.sh-B. b. c. d start // the listener uses this option on the specified IP address to bind the listener to the IP address that can be accessed by the specified Internet. My website is 192.168.20.3.130.
You also need to use iptables to open ports 8383 and 8384. The simplest is to disable iptables.
PHP-SDK configuration file modification, as shown below
[Configuration file] project. name = demoproject. default_charset = utf-8server.index = 192.168.116.130: 8383 // address of the Index Server, 8383server by default. search = 192.168.116.130: 8384 // search the server address, the default value is 8384 [pid] type = id [subject] type = title // set the indexed field [message] type = body // set the indexed field [chrono] type = numeric [configuration file]
Specific use details please check the user manual: http://www.xunsearch.com/doc/php/guide/index.overview
Performance test: