Mkdir/usr/local/sphinx/scripts----0. All primary indexes new #!/bin/bash#[email protected] #main_index_update. sh/usr/local/ Sphinx/bin/indexer src2-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin /indexer src3-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer Src4-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src5-c/usr /local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1----1. Incremental index #!/bin/bash#[email protected]# Delta_index_update.sh/usr/local/sphinx/bin/indexer src2_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/ Dev/null 2>&1/usr/local/sphinx/bin/indexer src3_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/ Null 2>&1/usr/local/sphinx/bin/indexer src4_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src5_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1---2. Merging indexes #!/bin/bash#[email protected] #merge_ daily_index.sh# Merge "main + Delta" indexes# #1. Index Abount tblpnr/usr/local/sphinx/bin/indexer--merge src2 src2_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter select 2, max (ID), Max (up date_time) from Jinripnr.tblpnr "fi# #2. Index Abount tblticketno/usr/local/sphinx/bin/indexer--merge src3 src3_delta-c/usr/local/sphinx/etc/sphinx.conf-- Rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter Select 3, MAX (ID), Max (update_time) from Jinritickno.tblticketno "fi# #3. Index Abount tblpassengername/usr/local/sphinx/bin/indexer--merge SRC4 src4_delta-c/USR/LOCAL/SPHinx/etc/sphinx.conf--rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter Select 4, MAX (ID), Max (update_time) from Jinripname.tblpassengername "fi# #4. Index Abount tblorderno/usr/local/sphinx/bin/indexer--merge src5 src5_delta-c/usr/local/sphinx/etc/sphinx.conf-- Rotate >>/usr/local/sphinx/var/log/index_merge.log 2>&1if ["$?"-eq 0]; Then/usr/local/mysql/bin/mysql-h127.0.0.1-uroot-ppassword-e "REPLACE into Jinri.sph_counter Select 5, MAX (ID), Max (update_time) from Jinriorderno.tblorderno "fi### #再次新建增量索引 #delta_index_update.sh/usr/local/sphinx/bin/indexer Src2_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src3 _delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src4_ Delta-c/usr/local/sphinx/etc/sphinx.conf--rotate >/dev/null 2>&1/usr/local/sphinx/bin/indexer src5_delta-c/usr/local/sphinx/etc/ sphinx.conf--rotate >/dev/null 2>&1 # crontab-l# CRONTAB-E*/5 * * * */usr/local/mysql/scripts/delta_index _update.sh0 2 * * */usr/local/mysql/scripts/merge_daily_index.sh---Merge syntax/usr/local/sphinx/bin/indexer--merge src3 src 3_delta-c/usr/local/sphinx/etc/sphinx.conf--rotate--merge-dst-range deleted 0 0--merge-killlists--View Job execution log tail-f /var/log/cron
"Combat" Sphinx the index merge script