Sphinx Full-Text Search engine usage guide: MySQL storage engine

Source: Internet
Author: User
Keywords MySQL use guide Sphinx Full-text search engine
Tags compiled configure copy data directory file files full-text search

6.1. Sphinxse Overview

Sphinxse is a MySQL storage engine that can be compiled into the MySQL 5.x version, leveraging the MySQL plug-in architecture of that version. Sphinxse cannot be used in the MySQL 4.x series, it requires MySQL 5.0.22 or later, or MySQL 5.1.12 or later.

Although called the "storage Engine," SPHINXSE does not actually store any data. It is actually an embedded client that allows the MySQL server to interact with SEARCHD and get search results. All indexes and searches take place outside of MySQL.

Obviously, the sphinxse applies to:

? enable the porting of MySQL FTS applications to Sphinx

? Those languages that do not have the Sphinx API can also use Sphinx

Provide optimizations when you need to do extra processing on the Sphinx result set on the MySQL side (for example, extra filtering on the original document table Join,mysql)

6.2. Install Sphinxse

You need to get a copy of MySQL source code and recompile MySQL. MySQL source code (MYSQL-5.X.YY.TAR.GZ) can be obtained from the dev.mysql.com website.

For some versions of the Mysql,sphinx Web site, a patched tarballs package containing support Sphinxse is provided. By extracting these files and replacing the original files, you can configure (configure), build to generate MySQL with built-in Shpinx support.

If there is no corresponding version of Tarballs on the site, or if for some reason it is not working, you may need to prepare these files by hand. You need an installed gun Autotools framework (Autoconf,automake and Libtool) to complete this task.

6.2.1. Compiling sphinxse on MySQL 5.0.x

If you use a patched tarballs that we made beforehand, skip step 1-3

1. Copy the Sphinx5.0.yy.diff patch file to the MySQL source directory and run

Patch-p1 < Sphinx.5.0.yy.diff

If you don't have a. diff file that exactly matches your MySQL version, try one of the closest version of the. diff file. Ensure the smooth application of the patch, no rejects.

2. Running in MySQL source directory

SH build/autorun.sh

3. Create the Sql/sphinx directory in the MySQL source directory and copy all files from the Mysqlse directory in the Sphinx source directory to this directory.

cp

-r/root/builds/sphinx-0.9.7/mysqlse/root/builds/mysql-5.0.24/sql/sphinx

4. Configuration (Configure) MySQL, enable Sphinx engine

./configure--with-sphinx-storage-engine

5. Build and install MySQL

Make

Make install

6.2.2. Compiling sphinxse on MySQL 5.1.x

If you use a patched tarballs that we made beforehand, skip step 1-3

1. Create the Storage/sphinx directory in the MySQL source directory and copy all files from the Mysqlse directory in the Sphinx source directory to this directory.

cp

-R/ROOT/BUILDS/SPHINX-0.9.7/MYSQLSE/ROOT/BUILDS/MYSQL-5.1.14/STORAGE/SPH Inx

2. mysql Source directory run

SH build/autorun.sh

3. Configuration (Configure) MySQL, enable Sphinx engine

./configure--with-plugins=sphinx

4. Build and install MySQL

Make

Make install

Related Article

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.