这个功能很简单,做好sphinx配置文件之后,就可以通过shell脚本,一键更新sphinx索引,一共分了以下几个步骤:
1.终止sphinx
2.删除原来的sphinx索引文件
3.sphinx名称选择器
4.生成sphinx索引文件
5.启动sphinx
下面直接上代码:
#!/bin/sh
#author 五个A的猪
#date 2020.12.16
. /etc/rc.d/init.d/functions
#sphinx名称选择器start
cat<<-eof
1-test1 #sphinx名称
2-test2
3-test3
eof
read -p "*sphinx name**:" cmd
case $cmd in
all)
sphinxName=