PHP Senior Engineer's Sphinx Chinese full-text index
Share with you here the full-text index Sphinx installation configuration and operational concepts supported by Mysql5.5.
If there is a bad, more comments (qq:1595068971-e-mail: [email protected])
Sphinx Server Support Network
Working principle :
file Package file :
API: Use PHP to manipulate Sphinx to access this file.
Bin: frequently used commands (Generate Sphinx index files, manipulate services).
ETC: Configuration file (csft_mysql.conf,uni.lib "Mass thesaurus file is also called cut Word file"). BEIJING-Tiananmen Square
Var:sphinx the log file in the run.
Generating a Sphinx Index file takes the results of the SQL Query Association statement and throws it into the Sphinx resource bundle to produce a binary resource file (storing SQL statement query results)
1. Configuration
2. Build Index file
Save File as replacement code
3.php Operation Sphinx:
PHP Operation Sphinx:
Connect sphinx_api.php file under Api:api folder, introduce API class
$SC = new Sphinxclient (); Instantiate the Sphinx class
$SC->setserver (' localhost ', 9312) connection service
$SC->setconnecttimeout (10) connection time-out
$SC->setmaxquerytime (30) Maximum query time
$SC->setarrayresult (True) returns a value type (array)
$SC->setmatchmode (Sph_match_any) Way of cutting words
(Sph_match_all: Exact match only query "' Beijing ', ' Tiananmen ', ' Beijing Tian ' an Men '")
(Sph_match_any: Single match "' Three words One matches '")
(Sph_match_phrase: Non-cut words)
$result = $sc->query ($post, "*") query index file (keyword, select)
Matches return search records after search
Sphinx dead Vince United MySQL implementation Chinese full-text index