Coreseek (Sphinx) Installation 2 (MySQL data source configuration and testing)

Source: Internet
Author: User

MySQL data source configuration under Windows operating system :

Main steps: Configure MySQL data source configuration file, build index, open index (three steps)

Coreseek\etc\csft_mysql.conf ( Below is my profile )

# Source Definition

SOURCE MySQL

{

type = mysql # means mysql data source

sql_host = localhost # database server link , 127.0.0.1 can also

Sql_user = root # database user name

Sql_pass = root # Database password

sql_db = yii # database name

Sql_port = 3306 # port number

Sql_query_pre = SET NAMES UTF8 #

Sql_query = SELECT ID, name, aid from ZZZ

                                                                  #sql_query first column id must be an integer

#title,content as a string / text field, indexed by the full text

#sql_attr_uint = group_id # The value read from SQL must be an integer

#sql_attr_timestamp = date_added # The value read from SQL must be an integer, as a time attribute

Sql_query_info_pre = set NAMES UTF8 # command line query when setting the correct character sets

Sql_query_info = SELECT * from zzz where id= $id # command-line query, read raw data information from the database

}

#index Definition

Index MySQL

{

Source = mysql # corresponding source name

Path = e:/www/coreseek/var/data/mysql # Please modify the absolute path to actually use, for example:/usr/local/coreseek/var/ ...

DocInfo = extern

Mlock = 0

Morphology = None

Min_word_len = 1

Html_strip = 0

# Chinese Word segmentation configuration, please see:http://www.coreseek.cn/products-install/coreseek_mmseg/

#charset_dictpath =/usr/local/mmseg3/etc/#BSD, settings under Linux,/ end of symbol

Charset_dictpath = e:/www/coreseek/etc/#Windows settings,/ end of symbol, it is best to give absolute path, for example: c:/usr/local/coreseek/etc/ ...

Charset_type = Zh_cn.utf-8

}

# Global index definition

Indexer

{

Mem_limit = 128M

}

#searchd Service Definition

Searchd

{

Listen = 9312

Read_timeout = 5

Max_children = 30

max_matches = 1000

Seamless_rotate = 0

preopen_indexes = 0

Unlink_old = 1

Pid_file = e:/www/coreseek/var/log/searchd_mysql.pid # Please modify the absolute path to actually use, for example:/usr/local/coreseek/var/...

Log = E:/www/coreseek/var/log/searchd_mysql.log # Please modify the absolute path to the actual use, for example:/usr/local/coreseek/var/ ...

Query_log = e:/www/coreseek/var/log/query_mysql.log # Please modify the absolute path to actually use, for example:/usr/local/coreseek/var/...

}

After configuring the MySQL data source , Ensure that your environment is normal ( during the use of the process , I have because Phpstudy Forget to start , looking for the wrong sundering. )

Next , run in Windows Command Window (windows+r cmd run )

Bin\indexer-c etc\csft_mysql.conf--all

( build index ) run out of this command , Coreseek\var\data more out of the directory 7 a MySQL file , That's right.

Turn on Sphinx Search Service

Bin\searchd-c etc\csft_mysql.conf

That's right ,,, This makes the MySQL index open , and then

You can try it in the project.

This is to keep MySQL Open Index, this window does not close,

Coreseek (Sphinx) Installation 2 (MySQL data source configuration and testing)

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.