生产线上的 sphinx 配置文件,主要针对pw时间:2022-12-16 19:35:42source threads { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO search_counter SELECT 3,MAX(tid),MIN(tid) FROM pw_threads sql_query_range = SELECT min_doc_id, max_doc_id FROM search_counter WHERE counterid = 3 sql_range_step = 1000 sql_query = SELECT th.tid,th.subject,th.authorid,th.postdate,th.lastpost,th.fid,th.digest,th.hits,th.replies,f.search_weight FROM pw_threads th LEFT JOIN pw_forums f USING(fid) WHERE th.tid >= $start AND th.tid <= $end sql_attr_uint = authorid sql_attr_uint = hits sql_attr_uint = replies sql_attr_uint = fid sql_attr_uint = search_weight sql_attr_timestamp = postdate sql_attr_timestamp = lastpost sql_attr_uint = digest } source addthreads { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_range = SELECT max_doc_id, max_doc_id+100000 FROM search_counter WHERE counterid = 3 sql_range_step = 100000 sql_query = SELECT th.tid,th.subject,th.authorid,th.postdate,th.lastpost,th.fid,th.digest,th.hits,th.replies,f.search_weight FROM pw_threads th LEFT JOIN pw_forums f USING(fid) WHERE th.tid >= $start AND th.tid <= $end sql_attr_uint = authorid sql_attr_uint = hits sql_attr_uint = replies sql_attr_uint = fid sql_attr_uint = search_weight sql_attr_timestamp = postdate sql_attr_timestamp = lastpost sql_attr_uint = digest sql_query_post = REPLACE INTO search_counter SELECT 3,MAX(tid),MIN(tid) FROM pw_threads } source tmsgs { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO search_counter SELECT 1,MAX(tid),MIN(tid) FROM pw_threads sql_query_range = SELECT min_doc_id, max_doc_id FROM search_counter WHERE counterid = 1 sql_range_step = 1000 sql_query = SELECT th.tid,th.subject,th.authorid,th.postdate,th.lastpost,th.fid,th.digest,th.hits,th.replies,t.content,f.search_weight FROM pw_threads th LEFT JOIN pw_forums f USING(fid) LEFT JOIN pw_tmsgs t USING(tid) WHERE th.tid >= $start AND th.tid <= $end sql_attr_uint = authorid sql_attr_uint = hits sql_attr_uint = replies sql_attr_uint = fid sql_attr_uint = search_weight sql_attr_timestamp = postdate sql_attr_timestamp = lastpost sql_attr_uint = digest } source addtmsgs { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_range = SELECT max_doc_id, max_doc_id+100000 FROM search_counter WHERE counterid = 1 sql_range_step = 100000 sql_query = SELECT th.tid,th.subject,th.authorid,th.postdate,th.lastpost,th.fid,th.digest,th.hits,th.replies,t.content,f.search_weight FROM pw_threads th LEFT JOIN pw_forums f USING(fid) LEFT JOIN pw_tmsgs t USING(tid) WHERE th.tid >= $start AND th.tid <= $end sql_attr_uint = authorid sql_attr_uint = hits sql_attr_uint = replies sql_attr_uint = fid sql_attr_uint = search_weight sql_attr_timestamp = postdate sql_attr_timestamp = lastpost sql_attr_uint = digest sql_query_post = REPLACE INTO search_counter SELECT 1,MAX(tid),MIN(tid) FROM pw_threads } source members { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO search_counter SELECT 5,MAX(uid),MIN(uid) FROM pw_members sql_query_range = SELECT min_doc_id, max_doc_id FROM search_counter WHERE counterid = 5 sql_range_step = 1000 sql_query = SELECT m.uid,m.username,m.gender,m.email,m.groupid,m.memberid,m.regdate,md.onlineip from pw_members m left join pw_memberdata md ON m.uid=md.uid WHERE m.uid >= $start AND m.uid <= $end sql_attr_uint = groupid sql_attr_uint = memberid sql_attr_uint = gender sql_attr_timestamp = regdate } source addmembers { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_range = SELECT max_doc_id, max_doc_id+100000 FROM search_counter WHERE counterid = 5 sql_range_step = 100000 sql_query = SELECT m.uid,m.username,m.gender,m.email,m.groupid,m.memberid,m.regdate,md.onlineip from pw_members m left join pw_memberdata md ON m.uid=md.uid WHERE m.uid >= $start AND m.uid <= $end sql_attr_uint = groupid sql_attr_uint = memberid sql_attr_uint = gender sql_attr_timestamp = regdate sql_query_post = REPLACE INTO search_counter SELECT 5,MAX(uid),MIN(uid) FROM pw_members } source diarys { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO search_counter SELECT 6,MAX(did),MIN(did) FROM pw_diary sql_query_range = SELECT min_doc_id, max_doc_id FROM search_counter WHERE counterid = 6 sql_range_step = 1000 sql_query = SELECT d.did,d.uid,d.dtid,d.aid,d.privacy,d.subject,d.username,d.ifcopy,d.copyurl,d.postdate FROM pw_diary d WHERE d.did >= $start AND d.did <= $end sql_attr_uint = dtid sql_attr_uint = uid sql_attr_timestamp = postdate } source adddiarys { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_range = SELECT max_doc_id, max_doc_id+100000 FROM search_counter WHERE counterid = 6 sql_range_step = 100000 sql_query = SELECT d.did,d.uid,d.dtid,d.aid,d.privacy,d.subject,d.username,d.ifcopy,d.copyurl,d.postdate FROM pw_diary d WHERE d.did >= $start AND d.did <= $end sql_attr_uint = dtid sql_attr_uint = uid sql_attr_timestamp = postdate sql_query_post = REPLACE INTO search_counter SELECT 6,MAX(did),MIN(did) FROM pw_diary } source diarycontents { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO search_counter SELECT 7,MAX(did),MIN(did) FROM pw_diary sql_query_range = SELECT min_doc_id, max_doc_id FROM search_counter WHERE counterid = 7 sql_range_step = 1000 sql_query = SELECT d.did,d.uid,d.dtid,d.aid,d.privacy,d.content,d.username,d.ifcopy,d.copyurl,d.postdate FROM pw_diary d WHERE d.did >= $start AND d.did <= $end sql_attr_uint = dtid sql_attr_uint = uid sql_attr_timestamp = postdate } source adddiarycontents { type = mysql sql_host = localhost sql_user = sphinx sql_pass = e sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_range = SELECT max_doc_id, max_doc_id+100000 FROM search_counter WHERE counterid = 1 sql_range_step = 100000 sql_query = SELECT d.did,d.uid,d.dtid,d.aid,d.privacy,d.content,d.username,d.ifcopy,d.copyurl,d.postdate FROM pw_diary d WHERE d.did >= $start AND d.did <= $end sql_attr_uint = dtid sql_attr_uint = uid sql_attr_timestamp = postdate sql_query_post = REPLACE INTO search_counter SELECT 7,MAX(did),MIN(did) FROM pw_diary } source diaryalls { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_pre = REPLACE INTO search_counter SELECT 8,MAX(did),MIN(did) FROM pw_diary sql_query_range = SELECT min_doc_id, max_doc_id FROM search_counter WHERE counterid = 8 sql_range_step = 1000 sql_query = SELECT d.did,d.uid,d.dtid,d.aid,d.privacy,d.subject,d.content,d.username,d.ifcopy,d.copyurl,d.postdate FROM pw_diary d WHERE d.did >= $start AND d.did <= $end sql_attr_uint = dtid sql_attr_uint = uid sql_attr_timestamp = postdate } source adddiaryalls { type = mysql sql_host = localhost sql_user = sphinx sql_pass = ee sql_db = xxoo sql_port = 3306 sql_sock = /tmp/mysql.sock sql_query_pre = SET NAMES utf8 sql_query_pre = SET SESSION query_cache_type=OFF sql_query_range = SELECT max_doc_id, max_doc_id+100000 FROM search_counter WHERE counterid = 8 sql_range_step = 100000 sql_query = SELECT d.did,d.uid,d.dtid,d.aid,d.privacy,d.subject,d.content,d.username,d.ifcopy,d.copyurl,d.postdate FROM pw_diary d WHERE d.did >= $start AND d.did <= $end sql_attr_uint = dtid sql_attr_uint = uid sql_attr_timestamp = postdate sql_query_post = REPLACE INTO search_counter SELECT 8,MAX(did),MIN(did) FROM pw_diary } #index part index threadsindex { source = threads path = /data/sphinx/threads docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index addthreadsindex { source = addthreads path = /data/sphinx/addthreads docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index tmsgsindex { source = tmsgs path = /data/sphinx/tmsgs docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index addtmsgsindex { source = addtmsgs path = /data/sphinx/addtmsgs docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index membersindex { source = members path = /data/sphinx/members docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index addmembersindex { source = addmembers path = /data/sphinx/addmembers docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index diarysindex { source = diarys path = /data/sphinx/diarys docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index adddiarysindex { source = adddiarys path = /data/sphinx/adddiarys docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index diarycontentsindex { source = diarycontents path = /data/sphinx/diarycontents docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index adddiarycontentsindex { source = adddiarycontents path = /data/sphinx/adddiarycontents docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index diaryallsindex { source = diaryalls path = /data/sphinx/diaryalls docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } index adddiaryallsindex { source = adddiaryalls path = /data/sphinx/adddiaryalls docinfo = extern morphology = none min_word_len = 1 charset_type = utf-8 min_prefix_len = 0 html_strip = 1 charset_table = 0..9, A..Z->a..z, _, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F ngram_len = 1 ngram_chars = U+3000..U+2FA1F } indexer { mem_limit = 128M } searchd { port = 4412 log = /var/log/sphinx/searchd.log query_log = /var/log/sphinx/query.log read_timeout = 5 max_children = 30 pid_file = /var/log/sphinx/searchd.pid max_matches = 1000 seamless_rotate = 1 preopen_indexes = 0 unlink_old = 1 }