Full-Text search engine installed under Linux---Sphinx (1)

Source: Internet
Author: User

1. Sphinx Full-Text search engine with sub-tar.gz package installation and RPM package installation

2. At present I use the RPM package for installation, after some toss, finally installed successfully.

3. Issues encountered when installing RPM:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/3E/49/wKioL1PHOlqx4q6XAAEATVRaqt0049.jpg "title=" Qq20140717103012.png "alt=" Wkiol1pholqx4q6xaaeatvraqt0049.jpg "/>

Workaround: Download the dependent package. A three-step download installation. The first two need to be downloaded, and the third one is directly installed

    • RPM-IVH mysql-shared-compat-5.1.47-1.rhel5.x86_64.rpm

    • RPM-IVH perl-dbd-mysql-3.0007-2.el5.x86_64.rpm

    • Yum-y Installmysql-connector-odbc (libodbc.so)

4. Solve the problem, install Sphinx directly, show the installation is successful

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/3E/4A/wKioL1PHOnSj7d1WAAHbA1Jrxqk272.jpg "title=" Qq20140717103056.png "alt=" Wkiol1phonsj7d1waahba1jrxqk272.jpg "/>

5. Sphinx execution starts, four steps required

    • Edit /etc/sphinx/sphinx.conf

## minimal sphinx configuration sample  (clean, simple,functional) # source  src1{        type                     = mysql        sql_host                  = 127.0.0.1//Database Address        sql_user                  = root   //Database Account         sql_pass                 = root//Database Password         sql_db                    = test//Database        sql_port                  =3306        #  optional, default is 3306//Database Port         sql_query                 = select  id,group_id,unix_timestamp (date_added)  as date_added,title,content fromdocuments   //select all the fields you want to query from your table        sql_query_info            =select * from documents where id= $id// Check out id} index test1{       source     from your table.                      =src1//data source Here is the door         path                          =/var/lib/sphinx/ test1//Resume Index Document storage location        docinfo                        =extern        charset_type                   = utf-8//Data Encoding} indexer{        mem_limit                 = 256m//Indexer Max use memory} searchd//It's basically not moving here {        listen                         =9312       listen                         =9306:mysql41         log                           =/var/ log/sphinx/searchd.log       query_log                      =/var/log/sphinx/ query.log       read_timeout                   =5        max_children                   =30       pid_file                       =/var/run/sphinx/searchd.pid        max_matches                    = 1000       seamless_rotate                 = 1        preopen_indexes                 = 1       unlink_old                       = 1       workers                          =threads # for rt  to work        binlog_path                   = /var/lib/sphinx/}





    • Manage Indexes Sudo–u Sphinx Indexer–all--rotate

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/3E/4B/wKiom1PHOf7TIAJAAAIUS9eOZ24889.jpg "title=" Qq20140717104427.png "alt=" Wkiom1phof7tiajaaaius9eoz24889.jpg "/>

    • Start the Search Daemon service searchd start

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/3E/4B/wKiom1PHOiawZThmAAE3b1vidDM577.jpg "title=" Qq20140717104436.png "alt=" Wkiom1phoiawzthmaae3b1viddm577.jpg "/>

    • Query search daemon using MySQL query, querying fields containing the keyword test


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/3E/4B/wKiom1PHOkGjQejqAAGhM2MY0B8504.jpg "title=" Qq20140717104517.png "alt=" Wkiom1phokgjqejqaaghm2my0b8504.jpg "/>


This article from "Life Like Summer Flowers" blog, declined reproduced!

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.