-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsphinx.conf
More file actions
73 lines (73 loc) · 2.99 KB
/
sphinx.conf
File metadata and controls
73 lines (73 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
source main
{
type = mysql
sql_host = localhost #此处为数据库地址
sql_user = root #用户名
sql_pass = root #密码
sql_db = db #数据库名称
sql_port = 3306
sql_sock = /tmp/mysql.sock (不是必须)
sql_query_pre = SET NAMES utf8
sql_query_pre = REPLACE INTO sph_counter_product SELECT 1,MAX(id) from job
#数据库中读取数据的sql
sql_query = SELECT id,name,companyname,radians(lat) as lat,radians(lng) as lng,salary,education,jobtype,secondtype,UNIX_TIMESTAMP(ctime) As ctime,UNIX_TIMESTAMP(mtime) As mtime from job where id<=(SELECT max_doc_id FROM sph_counter_product WHERE counter_id=1)
#支持全文索引
sql_field_string = name
#支持属性过滤
sql_attr_string = companyname
sql_attr_float = lat
sql_attr_float = lng
sql_attr_uint = salary
#sql_attr_uint = id
sql_attr_uint = education
sql_attr_uint = jobtype
sql_attr_uint = secondtype
sql_attr_timestamp = ctime
sql_attr_timestamp = mtime
sql_query_info_pre = SET NAMES utf8
sql_query_info = SELECT id,name,companyname,radians(lat) as lat,radians(lng) as lng,salary,education,jobtype,secondtype,UNIX_TIMESTAMP(ctime) As ctime,UNIX_TIMESTAMP(mtime) As mtime FROM job order by ctime desc
}
source delta : main
{
sql_query_pre = SET NAMES utf8
sql_query = SELECT id,name,companyname,radians(lat) as lat,radians(lng) as lng,salary,education,jobtype,secondtype,UNIX_TIMESTAMP(ctime) As ctime,UNIX_TIMESTAMP(mtime) As mtime FROM job WHERE id>(SELECT max_doc_id FROM sph_counter_product WHERE counter_id=1 )
sql_query_post_index = REPLACE INTO sph_counter_product SELECT 1,MAX(id) FROM job
}
#####index 定义
index main
{
source = main
path = /usr/local/sphinx/var/data/mysql
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
charset_dictpath = /usr/local/mmseg3/etc/
charset_type = zh_cn.utf-8
}
index delta : main
{
source = delta
path = /usr/local/sphinx/var/data/delta
}
#全局index定义
indexer
{
mem_limit = 256M
}
searchd
{
listen = 9312
read_timeout = 5
max_children = 30
max_matches = 1000
seamless_rotate = 0
preopen_indexes = 0
#attr_flush_period = 300
#compat_sphinxql_magics = 0 (默认不监听)
unlink_old = 1
pid_file = /usr/local/sphinx/var/log/searchd_mysql.pid #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
log = /usr/local/sphinx/var/log/searchd_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
query_log = /usr/local/sphinx/var/log/query_mysql.log #请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
}