Home Backend Development PHP Tutorial sphinx Introduction and installation of sphinx

sphinx Introduction and installation of sphinx

Jul 28, 2016 am 08:25 AM
sphinx

Introduction

Background:

1. Large amount of data, content review, existing search resume index is slow; staff turnover, existing search is difficult to maintain

2. Front-end calls are complex; full table scan is used, search speed is slow; the results are There is no sorting; it is difficult to find the most accurate data as quickly as possible

Suggested optimization:

1. High-speed index creation

2. Avoid doing like operations on the database and reduce pressure

3. Sort the search results by weight

4. Front-end development is easy to call

5. It is best to have a low threshold, easy to master and maintain in the future


Installation

1. Install the lamp environment

If you have already installed it, skip this step.
2. Download the required files
Note: If you use Ubuntu 10.10 (sphinxsearch), you can use apt-get install to install directly, you can skip this step (but Chinese word segmentation is not supported)
Coreseek Fulltext Server (source code): http://www.coreseek.cn/uploads/csft/3.1/Source/csft-3.1.tar.gz
Coreseek Mmseg (source code): http://www.coreseek.cn/uploads/csft/3.1/Source /mmseg-3.1.tar.gz
3. Tools must be installed
sudo apt-get install autoconf automake autotools-dev cpp curl gawk gcc lftp libc6-dev linux-libc-dev make libpcre3-dev libpcrecpp0 g++ libtool libncurses5-dev
sudo aptitude install libmysql++-dev libmysqlclient15-dev checkinstall
4. Install mmseg
sudo su
tar zxvf mmseg-3.1.tar.gz
mkdir /usr/local/mmseg
cd mmseg-3.1
./configure --prefix=/usr /local/mmseg
make
make install
5. Install sphinx
Note: If you use Ubuntu 10.10 (sphinxsearch), you can use sudo apt-get install sphinxsearch to quickly install (but Chinese word segmentation is not supported)
If not, use the following Command:
(If you are installing mysql manually below, please change --with-mysql to your corresponding mysql installation directory)
tar zxvf csft-3.1.tar.gz
mkdir /usr/local/coreseek
cd csft-3.1
./configure --prefix=/usr/local/coreseek --with-mysql --with-mmseg-includes=/usr/local/mmseg/include/mmseg --with-mmseg-libs=/usr/local/ mmseg/lib/
make clean
make
make install
6. Test
The installation is complete, the following is the test.
Note: If you use Ubuntu 10.10 (sphinxsearch), the following configuration file sphinx.conf.dist should be in /etc/sphinxsearch Directory
cd /usr/local/coreseek/etc
sudo cp sphinx.conf.dist sphinx.conf
sudo vim sphinx.conf (modification example is as follows)
mysql -uroot test < /usr/local/coreseek/etc/ example.sql (l creates a sample data table, of course you can also use phpmyadmin to import)
Note: If you use Ubuntu 10.10 (sphinxsearch), below you can directly use the commands sudo indexer --all and sudo search test
sudo /usr/ local/coreseek/bin/indexer -c /usr/local/coreseek/etc/sphinx.conf --all
sudo /usr/local/coreseek/bin/search -c /usr/local/coreseek/etc/sphinx.conf test

sudo /usr/local/coreseek/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf (start searchd process for sphinxapi call)



Note: If you use Ubuntu 10.10 (sphinxsearch ), the following parameters should be modified as follows:
path = /var/lib/sphinxsearch/data/idxbook1
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query. log
pid_file = /var/run/searchd.pid
Also, the charset_dictpath and charset_table parameters will not be supported, that is, Chinese word segmentation will not be supported

The above introduces the introduction and installation of sphinx, including sphinx content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to use php extension Sphinx for full text search How to use php extension Sphinx for full text search Jul 29, 2023 am 10:05 AM

How to use PHP extension Sphinx for full-text search Full-text search is one of the common requirements in modern web applications. In order to satisfy users' efficient query and retrieval of data, we can use Sphinx, a powerful open source search engine, to implement the full-text search function. Sphinx is written in C++ and provides PHP extensions to facilitate our use in PHP projects. This article will introduce how to use the PHP extension Sphinx for full-text search

Sphinx PHP application guide to implement full-text search Sphinx PHP application guide to implement full-text search Oct 03, 2023 am 08:37 AM

Introduction to the PHP application guide for implementing full-text search with Sphinx: In modern Web applications, the full-text search function has become an essential feature. Because users often search and match the content they need by entering keywords. In order to provide efficient and accurate search results, we need a powerful search engine. As an open source full-text search engine, Sphinx provides a perfect search solution for PHP. This article will introduce how to use Sphinx to implement

Sphinx implements real-time search effects for PHP projects Sphinx implements real-time search effects for PHP projects Oct 03, 2023 am 09:16 AM

Sphinx is an open source full-text search engine that can quickly and efficiently realize search and retrieval of large-scale data. In PHP projects, using Sphinx can achieve real-time search effects and improve user experience and search speed. This article will introduce how to use Sphinx in PHP projects and provide specific code examples. 1. Install Sphinx To achieve real-time search effects in PHP projects, you first need to install Sphinx. It can be found in Sphinx official website

Sphinx PHP application skills in natural language processing Sphinx PHP application skills in natural language processing Oct 03, 2023 am 09:53 AM

SphinxPHP application skills in natural language processing require specific code examples. With the development of the Internet and the advancement of artificial intelligence technology, natural language processing (Natural Language Processing, NLP) has become an important research direction in computer science. The goal of natural language processing is to enable computers to understand, interpret and generate natural language, making the communication between humans and machines more convenient and intelligent. In natural language processing, text retrieval is a very important

Analysis of PHP implementation method of Sphinx distributed search Analysis of PHP implementation method of Sphinx distributed search Oct 03, 2023 am 08:49 AM

Analysis of the PHP implementation method of Sphinx distributed search Introduction: In today's Internet era, search engines have become one of the main ways for people to obtain information. In order to provide more efficient and accurate search results, some large-scale websites or applications usually use distributed search engines to process search requests. Sphinx is a well-known distributed search engine with good performance and scalability. This article will introduce how to use PHP to implement Sphinx distributed search and provide specific code examples.

Sphinx implements fast search and cache optimization for PHP projects Sphinx implements fast search and cache optimization for PHP projects Oct 03, 2023 am 09:01 AM

Sphinx is an open source full-text search engine that can quickly process large amounts of data and provide efficient search capabilities. Using Sphinx in PHP projects can achieve fast search and cache optimization, improving project performance and user experience. This article will introduce how to integrate Sphinx in a PHP project and illustrate its usage and advantages through specific code examples. 1. Sphinx installation and configuration To use Sphinx, you first need to install and configure it on the server.

Research on PHP implementation method of Sphinx high-availability search Research on PHP implementation method of Sphinx high-availability search Oct 03, 2023 am 09:41 AM

Research introduction on PHP implementation method of Sphinx high-availability search: Sphinx is an open source full-text search engine, which provides fast, accurate and scalable search solutions. Integrating Sphinx into PHP websites can achieve highly available search functions. This article will explore how Sphinx is implemented in PHP and provide specific code examples. 1. Introduction to Sphinx Sphinx is a full-text search engine developed in C++. It focuses on fast and

Sphinx's practical approach to PHP language search optimization Sphinx's practical approach to PHP language search optimization Oct 03, 2023 am 09:24 AM

Sphinx's practical approach to PHP language search optimization requires specific code examples Summary: Sphinx is a powerful open source search engine tool that can be used to implement efficient search functions in web applications. This article will introduce how to use Sphinx for PHP language search optimization and provide detailed code examples. Introduction: With the rapid development of the Internet, users' demand for search functions is also increasing. Efficient search for large-scale data and accuracy of search results,

See all articles