本篇讲述Spyder环境所依赖的模块Sphinx搜索引擎,与大家分享。
source src1
{
type = mysql
sql_host = ip
sql_user = root
sql_pass = root
sql_db = test
sql_port = 3306
sql_query = SELECT id, name, description, UNIX_TIMESTAMP(created_at) AS created_at, group_id, rating FROM links
#sql_attr_uint = group_id
#sql_attr_timestamp = created_at
#sql_attr_float = rating
#sql_attr_multi = uint tags from query; SELECT link_id, tag_id FROM links_tags
#sql_query_info = SELECT * FROM links WHERE id=$id
sql_query_pre = SET NAMES utf8
}
index test1
{
source = src1
path = D:/data/sphinx-3.0.3/data/
#docinfo = extern
morphology = none
stopwords =
#charset_type = utf-8
#添加utf-8编码表
charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
#简单分词,搜索中文必须设置为1(只有0和1两个选项)
ngram_len = 1
# 需要分词的字符,搜索中文时必须
ngram_chars = U+3000..U+2FA1F
}
searchd
{
# [hostname:]port[:protocol], or /unix/socket/path to listen on
# known protocols are 'sphinx' (SphinxAPI) and 'mysql41' (SphinxQL)
#
# multi-value, multiple listen points are allowed
# optional, defaults are 9312:sphinx and 9306:mysql41, as below
#
# listen = 127.0.0.1
# listen = 192.168.0.1:9312
# listen = 9312
# listen = /var/run/searchd.sock
listen = 9312
listen = 9306:mysql41
# log file, searchd run info is logged here
# optional, default is 'searchd.log'
log = D:/data/sphinx-3.0.3/log/searchd.log
# query log file, all search queries are logged here
# optional, default is empty (do not log queries)
query_log = D:/data/sphinx-3.0.3/log/query.log
# client read timeout, seconds
# optional, default is 5
read_timeout = 5
# request timeout, seconds
# optional, default is 5 minutes
client_timeout = 300
# maximum amount of children to fork (concurrent searches to run)
# optional, default is 0 (unlimited)
max_children = 30
# maximum amount of persistent connections from this master to each agent host
# optional, but necessary if you use agent_persistent. It is reasonable to set the value
# as max_children, or less on the agent's hosts.
persistent_connections_limit = 30
# PID file, searchd process ID file name
# mandatory
pid_file = D:/data/sphinx-3.0.3/log/searchd.pid
# seamless rotate, prevents rotate stalls i