Sphinx dead Vince United MySQL implementation Chinese full-text index

Source: Internet
Author: User
Tags save file

       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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.