-
Notifications
You must be signed in to change notification settings - Fork 1
/
manticore.conf
91 lines (80 loc) · 2.81 KB
/
manticore.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
#!/bin/sh
ip=`hostname -i|rev|cut -d\ -f 1|rev`
cat << EOF
searchd {
binlog_path =
listen = 9306:mysql41
listen = /var/run/mysqld/mysqld.sock:mysql41
listen = $ip:9312
listen = 9308:http
listen = $ip:9315-9325:replication
log = /var/log/manticore/searchd.log
max_packet_size = 128M
pid_file = /var/run/manticore/searchd.pid
query_log_format = sphinxql
query_log = /var/log/manticore/query.log
}
source shared {
type = mysql
sql_host = $sql_host
sql_user = $sql_user
sql_pass = $sql_pass
sql_db = $sql_db
sql_query_pre = SET NAMES utf8
sql_query_pre = CREATE TABLE IF NOT EXISTS sph_counter (counter_id INTEGER PRIMARY KEY NOT NULL, max_doc_id INTEGER NOT NULL)
sql_attr_uint = tid
sql_attr_uint = fid
sql_attr_uint = digest
sql_attr_uint = displayorder
sql_attr_uint = authorid
sql_attr_uint = special
sql_attr_timestamp = lastpost
}
source threads : shared {
sql_query_range = SELECT MIN(tid),MAX(tid) FROM pre_forum_thread
sql_query = SELECT tid AS id,tid,fid,subject,digest,displayorder,authorid,lastpost,special FROM pre_forum_thread \
WHERE tid>=\$start AND tid<=\$end
sql_query_post_index = REPLACE INTO sph_counter set counter_id = 1, max_doc_id = \$maxid
}
source threads_minute : shared
{
sql_query = SELECT tid AS id,tid,fid,subject,digest,displayorder,authorid,lastpost,special FROM pre_forum_thread \
WHERE tid > (SELECT max_doc_id FROM sph_counter WHERE counter_id = 1)
}
source posts: shared {
sql_query_range = SELECT MIN(pid),MAX(pid) FROM pre_forum_post
sql_query = SELECT p.pid AS id,p.tid,t.fid,p.subject,p.message,t.digest,t.displayorder,t.authorid,t.lastpost,t.special \
FROM pre_forum_post AS p LEFT JOIN pre_forum_thread AS t USING(tid) \
WHERE pid>=\$start AND pid<=\$end
sql_query_post_index = REPLACE INTO sph_counter set counter_id = 2, max_doc_id = \$maxid
}
source posts_minute : shared
{
sql_query = SELECT p.pid AS id,p.tid,t.fid,p.subject,p.message,t.digest,t.displayorder,t.authorid,t.lastpost,t.special \
FROM pre_forum_post AS p LEFT JOIN pre_forum_thread AS t USING(tid) \
WHERE pid > (SELECT max_doc_id FROM sph_counter WHERE counter_id = 2)
}
index threads {
type = plain
source = threads
path = threads
charset_table = chinese
morphology = icu_chinese
stopwords = zh
}
index threads_minute : threads
{
source = threads_minute
path = threads_minute
}
index posts : threads
{
source = posts
path = posts
}
index posts_minute : threads
{
source = posts_minute
path = posts_minute
}
EOF