This article illustrates the method of PHP's fast generation of full-text search function under InnoDB engine. Share to everyone for your reference, specific as follows:
Equipment to be prepared: Liunx (Centos) operating system (Linux only), PHP environment.
Here introduces a Chinese search engine open Source project-Search (Xunsearch), it is divided into: Index Server and Search server.
Happy build server under CentOS
wget http://www.xunsearch.com/download/xunsearch-full-latest.tar.bz2
TAR-XJF xunsearch-full-latest.tar.bz2
Ready to install the
CD xunsearch-full-1.3.0/sh setup.sh//This can be a problem with installation failure because the extension is not installed with GCC gcc-c++. Installation with Yum is very simple
Installation of the time you enter the installation directory, is generally/usr/local/xunsearch enter and then input y return, installation a bit long.
Wait for the installation to complete.
When the installation is complete, how do I get across the server:
The installation directory (/usr/local/xunsearch/) +bin/xs-ctl.sh-b a.b.c.d start//Listener uses this on the specified IP to bind the listener to the IP that is reachable by the specified extranet. Mine is 192.168.1163.130.
There is also a need to use iptables to open ports 8383 and 8384. The simplest is to close the iptables.
PHP-SDK configuration file modifications, as follows
[Configuration file]
Project.name = Demo
project.default_charset = utf-8
Server.index = 192.168.116.130:8383//Index server address, default is 8383
Server.search = 192.168.116.130:8384//Search server address, default is 8384
[PID]
Type = ID
[subject]
type = title//set indexed field
[message]
type = Body //Set indexed field
[Chrono]
Type = numeric
[config file]
Please refer to the use manual for details of use: Http://www.xunsearch.com/doc/php/guide/index.overview
Performance test:
More about PHP Interested readers can view the site topics: "PHP Regular Expression Usage summary", "Php Curl Usage Summary", "PHP Array" operation Skills Encyclopedia, "PHP Sorting algorithm Summary", "PHP common traversal algorithm and skills summary", " PHP Data structure and algorithm tutorial, "PHP Programming Algorithm Summary", "PHP Mathematical Calculation Skills Summary", "PHP operation and operator Usage Summary", "PHP string (String) Usage summary" and "PHP common database Operation Skills Summary"
I hope this article will help you with the PHP program design.