diff --git a/plugins/sphinx/tpl/maccms.conf b/plugins/sphinx/tpl/maccms.conf index 08dbdc5b8..ec2222dfe 100644 --- a/plugins/sphinx/tpl/maccms.conf +++ b/plugins/sphinx/tpl/maccms.conf @@ -30,17 +30,6 @@ searchd # -------- maccms 全量更新 start -------- -index mac_vod -{ - source = mac_vod - path = {$SERVER_APP}/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 @@ -60,11 +49,33 @@ source mac_vod sql_attr_timestamp = vod_time_add } +index mac_vod +{ + source = mac_vod + path = {$SERVER_APP}/index/db/maccms/index + + min_word_len = 2 + html_strip = 1 + ngram_len = 1 + ngram_chars = U+3000..U+2FA1F +} + # -------- maccms 全量更新 end -------- # -------- maccms 增量更新 start -------- +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(vod_id) FROM mac_vod) 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_query_post = UPDATE sph_counter SET max_doc_id=(SELECT MAX(vod_id as id) FROM mac_vod) where counter_id=1 +} + index mac_vod_delta { source = mac_vod @@ -76,19 +87,4 @@ index mac_vod_delta 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(vod_id) FROM mac_vod) 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(vod_id) FROM mac_vod) where counter_id=1 -} - # -------- maccms 增量更新 end -------- \ No newline at end of file