Learn Sphinx Sphinx Chinese Django Sphinx python Sphinx usage

Source: Internet
Author: User
How do we use Sphinx technology in our PHP development?

A: The fields in the MySQL database are split into multiple words in a field, and the words are indexed. In the future, query these index files, then return the primary key IDs of the records that meet the criteria, then query the MySQL database based on the primary key ID and return the records.

What is Sphinx? (Baidu Encyclopedia)

Note: For Sphinx, single-table thousands records, the response time is the millisecond level.

Note: The default Sphinx only supports English and Russian

Website:

http://sphinxsearch.com/

Because Sphinx only support the above two languages, so there are third-party companies for the Sphinx development of the sub-word packet, called Coreseek

Website:

http://www.coreseek.cn/

Customer Case: http://www.coreseek.cn/products/ft_powered/

Note two points:

  1. Sphinx is a full-text search engine that supports only Russian and English

  2. Because of the above reasons, there are specialized companies for its development of Chinese word breaker, called Coresesk.

  3. China has a better company to do (massive participle)

    http://www.hylanda.com/

    Story: http://home.hylanda.com/show_5_19.html

    Real Exercise

  4. Download

    2. Build a table of Big data (lyrics table)

    MySQL > Source d:/songs.sql

    File directory:

    Command:

    Sphinx Installation-Use

    Installation

    Note: Sphinx configuration files must not be opened using Windows Notepad. (BOM header)

    API interface File: You can use PHP to invoke the interface to operate the Sphinx Server-side index file.

  5. Modifying a configuration file

    Index file

    Memory settings:

    SPHINXD configuration:

  6. Build an index

    Name after index in the configuration file

    The directory structure after the index is built

    3. Actual use

    A. Turn on Sphinx Services and use the Help information to see how to use

    Use:

  7. You can run a separate read configuration file

  8. can also be installed as a Windows system service to run

    Start the Sphinx service (read profile one-time boot)

    After defined as system service (install)

    Use

    1. Specific use (Sphinx process can be seen)

    Sphinx Flowchart:

    Sphinx Storage Engine: Through the following steps found that the PHP program in the query, you must first return the primary key ID according to the Sphinx server, and then according to the primary key ID to query the MySQL database, and finally return to the database.

    This time, you can think of this, sphinx as a storage engine for MySQL, this time the PHP program can directly connect to the MySQL server, the MySQL server to its own Sphinx storage engine to obtain the data after the word. There is no need to connect the Sphinx server once. This storage engine is called Sphinxse.

    http://blog.csdn.net/uestc_huan/article/details/6395145

  9. Simple to use

  10. Use

The above describes the learning Sphinx, including the content of the Sphinx, I hope that the PHP tutorial interested in a friend helpful.

  • 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.