forked from jlbyrey/1chan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1chan.conf
156 lines (124 loc) · 4.74 KB
/
1chan.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
source posts
{
type = mysql
sql_host = localhost
sql_user = <DB_USER>
sql_pass = <DB_PASSWORD>
sql_db = <DB_NAME>
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query_pre = SET CHARACTER SET utf8
sql_query = SELECT id, rated, category, created_at, updated_at, link, title, text, text_full, rate, comments FROM 1chan_post WHERE hidden = 0
sql_attr_bool = rated
sql_attr_uint = category
sql_attr_bigint = rate
sql_attr_uint = comments
sql_attr_timestamp = created_at
sql_attr_timestamp = updated_at
sql_query_info = SELECT * FROM 1chan_post WHERE ID = $id
}
source forceometer {
type = mysql
sql_host = localhost
sql_user = <DB_USER>
sql_pass = <DB_PASSWORD>
sql_db = <DB_NAME>
sql_port = 3306
sql_query_pre = SET NAMES utf8
sql_query_pre = SET CHARACTER SET utf8
sql_query_pre = CREATE TEMPORARY TABLE \
1chan_forceometer_index ( \
id INT NOT NULL, \
ip VARCHAR(16), \
title VARCHAR(255) DEFAULT '', \
text TEXT, \
created_at INT(32) NOT NULL, \
uniq_f INT(1) NOT NULL DEFAULT 0, \
uniq_m INT(1) NOT NULL DEFAULT 0, \
PRIMARY KEY (id), KEY (ip) \
) \
TYPE=MyISAM;
sql_query_pre = INSERT IGNORE INTO 1chan_forceometer_index (id, ip, title, text, created_at) \
SELECT 1chan_post.id, 1chan_post.ip, 1chan_post.title, CONCAT(1chan_post.text, ' ', 1chan_post.text_full) as text, 1chan_post.created_at \
FROM 1chan_post;
sql_query_pre = INSERT IGNORE INTO 1chan_forceometer_index (id, ip, text, created_at) \
SELECT 1chan_comment.id, 1chan_comment.ip, 1chan_comment.text, 1chan_comment.created_at \
FROM 1chan_comment;
sql_query_pre = UPDATE 1chan_forceometer_index, \
( \
SELECT id, ip, FROM_UNIXTIME(created_at, '%Y%m') as month_at \
FROM 1chan_comment \
GROUP BY ip, month_at \
) as slice \
SET 1chan_forceometer_index.uniq_m = 1 \
WHERE 1chan_forceometer_index.id = slice.id;
sql_query_pre = UPDATE 1chan_forceometer_index, \
( \
SELECT id, ip, FROM_UNIXTIME(created_at, '%Y%m') as month_at \
FROM 1chan_post \
GROUP BY ip, month_at \
) as slice \
SET 1chan_forceometer_index.uniq_m = 1 \
WHERE 1chan_forceometer_index.id = slice.id;
sql_query_pre = UPDATE 1chan_forceometer_index, \
( \
SELECT id \
FROM 1chan_comment \
GROUP BY ip \
) as slice \
SET 1chan_forceometer_index.uniq_f = 1 \
WHERE 1chan_forceometer_index.id = slice.id;
sql_query_pre = UPDATE 1chan_forceometer_index, \
( \
SELECT id \
FROM 1chan_post \
GROUP BY ip \
) as slice \
SET 1chan_forceometer_index.uniq_f = 1 \
WHERE 1chan_forceometer_index.id = slice.id;
sql_query = SELECT id, title, text, created_at, uniq_m, uniq_f FROM 1chan_forceometer_index;
sql_attr_bool = uniq_m
sql_attr_bool = uniq_f
sql_attr_timestamp = created_at
}
index forceometer
{
source = forceometer
path = /var/lib/sphinxsearch/data/forceometer
docinfo = extern
mlock = 0
min_word_len = 3
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
phrase_boundary = ., ?, !
html_strip = 1
}
index posts
{
source = posts
path = /var/lib/sphinxsearch/data/posts
docinfo = extern
mlock = 0
min_word_len = 2
morphology = stem_en, stem_ru, soundex
charset_type = utf-8
charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F
phrase_boundary = ., ?, !
html_strip = 1
min_infix_len = 2
enable_star = 1
}
indexer
{
mem_limit = 64M
max_iops = 40
}
searchd
{
port = 3312
log = /var/lib/sphinxsearch/data/searchd.log
read_timeout = 5
max_children = 30
pid_file = /var/www/1chan.ru/searchd.pid
max_matches = 1000
}