Create maccms.conf

This commit is contained in:
Mr Chen
2023-11-19 16:54:36 +08:00
parent 77361259c3
commit 096dfa6b96
+94
View File
@@ -0,0 +1,94 @@
#
# Maccms Sphinx Config File
#
# 创建统计表
# CREATE TABLE `sph_counter` ( `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT, `counter_id` bigint(20) unsigned NOT NULL,`max_doc_id` bigint(20) unsigned NOT NULL,PRIMARY KEY (`id`))
indexer
{
mem_limit = 32M
write_buffer = 64M
}
searchd
{
listen = 9312
listen = 9306:mysql41
log = {$SERVER_APP}/index/searchd.log
query_log = {$SERVER_APP}/index/query.log
read_timeout = 5
max_children = 0
pid_file = {$SERVER_APP}/index/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
#workers = threads # for RT to work
binlog_path = {$SERVER_APP}/index/binlog
}
# -------- 全量更新 start --------
index mac_vod
{
source = mac_vod
path = /www/server/sphinx/index/db/maccms/index
min_word_len = 2
html_strip = 1
ngram_len = 1
ngram_chars = U+3000..U+2FA1F
}
source mac_vod
{
type = mysql
sql_host = 127.0.0.1
sql_user = hongtao
sql_pass = Nsa6KJi6G58nGhtF
sql_db = hongtao
sql_port = 3306
sql_query_range = SELECT min(vod_id), max(vod_id) FROM mac_vod
sql_query_pre = SET NAMES UTF8
sql_query_pre = SET SESSION query_cache_type=OFF
sql_query = SELECT vod_id as id, vod_name, vod_time,vod_time_add FROM mac_vod WHERE vod_id>=$start AND vod_id<=$end
sql_range_step = 1000
sql_attr_timestamp = vod_time
sql_attr_timestamp = vod_time_add
}
# -------- 全量更新 end --------
# -------- 增量更新 start --------
index mac_vod_delta
{
source = mac_vod
path = /www/server/sphinx/index/db/maccms_delta/index
min_word_len = 2
html_strip = 1
ngram_len = 1
ngram_chars = U+3000..U+2FA1F
}
source mac_vod_delta : mac_vod
{
sql_query_pre = SET NAMES utf8
sql_query_range = SELECT (SELECT max_doc_id FROM `sph_counter` where counter_id=1) as min, (SELECT max(id) FROM search_hash) as max
sql_query = SELECT vod_id as id, vod_name, vod_time,vod_time_add FROM mac_vod WHERE vod_id>=$start AND vod_id<=$end
sql_attr_timestamp = vod_time
sql_attr_timestamp = vod_time_add
sql_query_post = UPDATE sph_counter SET max_doc_id=(SELECT MAX(id) FROM search_hash) where counter_id=1
}
# -------- 增量更新 end --------