forked from yunge/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sphinx.conf
106 lines (95 loc) · 2.32 KB
/
sphinx.conf
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
source base
{
type = mysql
sql_host = localhost
sql_port = 3306 # optional, default is 3306
sql_sock = /var/lib/mysql/mysql.sock
sql_user = root
sql_pass = yourPassword # Change to your mysql password!
sql_query_pre = SET NAMES utf8
}
source src1:base
{
sql_db = test
sql_query = \
SELECT id, cate_ids, group_id, group_id2, UNIX_TIMESTAMP(date_added) AS date_added, title, content, radians(latitude) as latitude, radians(longitude) as longitude \
FROM documents
sql_attr_uint = group_id
sql_attr_uint = group_id2
sql_attr_timestamp = date_added
sql_attr_multi = uint cate_ids from field
sql_attr_float = latitude
sql_attr_float = longitude
sql_ranged_throttle = 0
sql_query_info = SELECT * FROM documents WHERE id=$id
}
index test1
{
source = src1
path = /usr/local/sphinx/var/data/test1
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
charset_type = sbcs # known types are 'sbcs' (Single Byte CharSet) and 'utf-8'
html_strip = 0
}
source xml
{
type = xmlpipe2
xmlpipe_command = cat /usr/local/sphinx/var/data/test.xml # Change to your xml file path!
}
index xml
{
source = xml
path = /usr/local/sphinx/var/data/xml
docinfo = extern
mlock = 0
morphology = none
min_word_len = 1
html_strip = 0
charset_type = utf-8
}
index rt
{
type = rt
path = /usr/local/sphinx/var/data/rt
rt_field = title
rt_field = content
rt_attr_uint = group_id
rt_mem_limit = 32M
}
indexer
{
mem_limit = 32M
# max_iops = 40
# max_iosize = 1048576
# max_xmlpipe2_field = 4M
# write_buffer = 1M
# max_file_field_buffer = 32M
}
searchd
{
#listen = /var/run/searchd.sock
listen = 0.0.0.0:9312
listen = 0.0.0.0:9306:mysql41
pid_file = /var/run/searchd.pid
log = /var/log/searchd.log
query_log = /var/log/query.log
binlog_path = /usr/local/sphinx/var/data
binlog_flush = 2
binlog_max_log_size = 16M
read_timeout = 5
client_timeout = 3000
max_children = 0
max_matches = 1000
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
mva_updates_pool = 1M
max_packet_size = 8M
max_filters = 256
max_filter_values = 4096
max_batch_queries = 32
workers = threads # This is the only mode compatible with RT indexing backend.
}