Introduction and installation of Sphinx Sphinx

Source: Internet
Author: User
Brief introduction

Background:

1. Large amount of data, content audit the existing search resume index is slow; people flow, existing searches are difficult to maintain

2. The front-end call is complex; With full table scan, the search speed is slow; the results are not sorted; It is difficult to find the most accurate data quickly

Recommended Optimizations:

1. High-speed index creation

2. Avoid like operations on the database and reduce stress

3. Sort the results of the search by weight

4. Front-end development for easy invocation

5. The best threshold is low, easy to master and post-maintenance

Installation

1. Install lamp environment

Skip this step if you have already installed it.
2. Download the required documents
Note: If you use Ubuntu 10.10 (sphinxsearch), you can use the Apt-get install direct installation, you can skip this step (but do not support Chinese word segmentation)
Coreseek fulltext Server (source code): http://www.coreseek.cn/uploads/csft/3.1/Source/csft-3.1.tar.gz
Coreseek mmseg (source code): http://www.coreseek.cn/uploads/csft/3.1/Source/mmseg-3.1.tar.gz
3. Tools must be installed
sudo apt-get install autoconf automake autotools-dev cpp Curl gawk gcc lftp libc6-dev linux-libc-dev make Libpcre3-dev Lib Pcrecpp0 g++ Libtool Libncurses5-dev
sudo aptitude install Libmysql++-dev Libmysqlclient15-dev Checkinstall
4. Installing MMSEG
sudo su
Tar zxvf mmseg-3.1.tar.gz
Mkdir/usr/local/mmseg
CD mmseg-3.1
./configure--prefix=/usr/local/mmseg
Make
Make install
5. Installing Sphinx
Note: If you use Ubuntu 10.10 (sphinxsearch), you can use the sudo apt-get install Sphinxsearch quick installation (but not Chinese word breakers)
If not, use the following command:
(The following if the manual installation of the MySQL note to change the--with-mysql to their own corresponding MySQL installation directory)
Tar zxvf csft-3.1.tar.gz
Mkdir/usr/local/coreseek
CD csft-3.1
./configure--prefix=/usr/local/coreseek--with-mysql--with-mmseg-includes=/usr/local/mmseg/include/mmseg-- with-mmseg-libs=/usr/local/mmseg/lib/
Make clean
Make
Make install
6. Testing
The installation is complete and the following is the test.
Note: If you use Ubuntu 10.10 (sphinxsearch), the following configuration file sphinx.conf.dist should be in the/etc/sphinxsearch directory
Cd/usr/local/coreseek/etc
sudo cp sphinx.conf.dist sphinx.conf
sudo vim sphinx.conf (modify example below)
Mysql-uroot Test </usr/local/coreseek/etc/example.sql (l create a sample datasheet, of course you can also import with phpMyAdmin)
Note: If you use Ubuntu 10.10 (sphinxsearch), below you can directly take the command sudo indexer--all and sudo search test
Sudo/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/sphinx.conf--all
Sudo/usr/local/coreseek/bin/search-c/usr/local/coreseek/etc/sphinx.conf Test

Sudo/usr/local/coreseek/bin/searchd-c/usr/local/coreseek/etc/sphinx.conf (Start searchd process for Sphinxapi call)



Note: If you use Ubuntu 10.10 (sphinxsearch), the following parameters should be modified to resemble the following:
Path =/var/lib/sphinxsearch/data/idxbook1
Log =/var/log/sphinxsearch/searchd.log
Query_log =/var/log/sphinxsearch/query.log
Pid_file =/var/run/searchd.pid
There will be no support for Charset_dictpath and charset_table parameters, that is, Chinese word segmentation is not supported

The above describes the introduction and installation of Sphinx Sphinx, including the Sphinx aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.