A concise tutorial on the fast generation of Full-text search features in PHP under the InnoDB engine "based on Xunsearch" _php tips

Source: Internet
Author: User
Tags bz2 php programming php regular expression iptables

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.

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.