【实战】sphinx索引合并的脚本
mkdir /usr/local/sphinx/scripts----0.全部主索引新建#!/bin/bash#ocpyang@126.com#main_index_update.sh/usr/local/sphinx/bin/indexer src2 -c /usr/local/sphinx/etc/sphinx.conf --rotate /dev/null 21/usr/local/sphinx/bin/indexer src3 -c /usr/loca
mkdir /usr/local/sphinx/scripts ----0.全部主索引新建 #!/bin/bash #ocpyang@126.com #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.增量索引 #!/bin/bash #ocpyang@126.com #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.合并索引 #!/bin/bash #ocpyang@126.com #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>&1 if [ "$?" -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(update_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>&1 if [ "$?" -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>&1 if [ "$?" -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>&1 if [ "$?" -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.sh 0 2 * * * /usr/local/mysql/scripts/merge_daily_index.sh ---合并语法 /usr/local/sphinx/bin/indexer --merge src3 src3_delta -c /usr/local/sphinx/etc/sphinx.conf \ --rotate --merge-dst-range deleted 0 0 --merge-killlists --查看job执行日志 tail -f /var/log/cron

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to execute .sh file in Linux system? In Linux systems, a .sh file is a file called a Shell script, which is used to execute a series of commands. Executing .sh files is a very common operation. This article will introduce how to execute .sh files in Linux systems and provide specific code examples. Method 1: Use an absolute path to execute a .sh file. To execute a .sh file in a Linux system, you can use an absolute path to specify the location of the file. The following are the specific steps: Open the terminal

Cutting is a video editing tool with comprehensive editing functions, support for variable speed, various filters and beauty effects, and rich music library resources. In this software, you can edit videos directly or create editing scripts, but how to do it? In this tutorial, the editor will introduce the method of editing and making scripts. Production method: 1. Click to open the editing software on your computer, then find the "Creation Script" option and click to open. 2. In the creation script page, enter the "script title", and then enter a brief introduction to the shooting content in the outline. 3. How can I see the "Storyboard Description" option in the outline?

Overview of advanced functions of how to use HTML, CSS and jQuery to implement image merge display: In web design, image display is an important link, and image merge display is one of the common techniques to improve page loading speed and enhance user experience. This article will introduce how to use HTML, CSS and jQuery to implement advanced functions of image merging and display, and provide specific code examples. 1. HTML layout: First, we need to create a container in HTML to display the merged images. You can use di

Oracle index types include: 1. B-Tree index; 2. Bitmap index; 3. Function index; 4. Hash index; 5. Reverse key index; 6. Local index; 7. Global index; 8. Domain index ; 9. Bitmap connection index; 10. Composite index. Detailed introduction: 1. B-Tree index is a self-balancing tree data structure that can efficiently support concurrent operations. In Oracle database, B-Tree index is the most commonly used index type; 2. Bit Graph index is an index type based on bitmap algorithm and so on.

We've designed this Windows PowerShell scripting tutorial for beginners, whether you're a tech enthusiast or a professional looking to improve your scripting skills. If you have no prior knowledge of PowerShell scripting, this article will start with the basics and be tailored for you. We'll help you master the installation steps for a PowerShell environment and walk you through the main concepts and features of PowerShell scripts. If you're ready to learn more about PowerShell scripting, let's embark on this exciting learning journey together! What is WindowsPowerShell? PowerShell is a hybrid command system developed by Microsoft

PHP Practice: Code Example to Quickly Implement the Fibonacci Sequence The Fibonacci Sequence is a very interesting and common sequence in mathematics. It is defined as follows: the first and second numbers are 0 and 1, and from the third Starting with numbers, each number is the sum of the previous two numbers. The first few numbers in the Fibonacci sequence are 0,1,1.2,3,5,8,13,21,...and so on. In PHP, we can generate the Fibonacci sequence through recursion and iteration. Below we will show these two

Word documents are one of the most frequently used applications in our daily work and study. When working with documents, you may sometimes encounter a situation where you need to merge two pages into one. This article will introduce in detail how to merge two pages into one page in a Word document to help readers handle document layout more efficiently. In Word documents, the operation of merging two pages into one is usually used to save paper and printing costs, or to make the document more compact and neat. The following are the specific steps to merge two pages into one: Step 1: Open the Word that needs to be operated

The data export function is a very common requirement in actual development, especially in scenarios such as back-end management systems or data report export. This article will take the Golang language as an example to share the implementation skills of the data export function and give specific code examples. 1. Environment preparation Before starting, make sure you have installed the Golang environment and are familiar with the basic syntax and operations of Golang. In addition, in order to implement the data export function, you may need to use a third-party library, such as github.com/360EntSec
