search
HomeBackend DevelopmentPHP Tutorialsphinx Introduction and installation of 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 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
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
如何使用php扩展Sphinx进行全文搜索如何使用php扩展Sphinx进行全文搜索Jul 29, 2023 am 10:05 AM

如何使用PHP扩展Sphinx进行全文搜索全文搜索是现代Web应用程序中的常见需求之一。为了满足用户对数据的高效查询和检索,我们可以使用Sphinx这个功能强大的开源搜索引擎来实现全文搜索功能。Sphinx使用C++编写,提供了PHP的扩展,方便我们在PHP项目中使用。本文将介绍如何使用PHP扩展Sphinx进行全文搜索

Sphinx 实现全文搜索的 PHP 应用指南Sphinx 实现全文搜索的 PHP 应用指南Oct 03, 2023 am 08:37 AM

Sphinx实现全文搜索的PHP应用指南引言:在现代的Web应用中,全文搜索功能已经成为了一个必备的特性。因为用户常常会通过输入关键词来搜索和匹配他们所需要的内容。为了提供高效和准确的搜索结果,我们需要一个强大的搜索引擎。而Sphinx作为一个开源的全文搜索引擎,它为PHP提供了一个完美的搜索解决方案。本文将介绍如何使用Sphinx实现

Sphinx 实现 PHP 项目的实时搜索效果Sphinx 实现 PHP 项目的实时搜索效果Oct 03, 2023 am 09:16 AM

Sphinx是一个开源的全文搜索引擎,可以快速、高效地实现大规模数据的搜索和检索。在PHP项目中,使用Sphinx可以实现实时搜索效果,提升用户体验和搜索速度。本文将介绍如何在PHP项目中使用Sphinx,并提供具体的代码示例。一、安装Sphinx要在PHP项目中实现实时搜索效果,首先需要安装Sphinx。可以在Sphinx的官方

Sphinx PHP 在自然语言处理中的应用技巧Sphinx PHP 在自然语言处理中的应用技巧Oct 03, 2023 am 09:53 AM

SphinxPHP在自然语言处理中的应用技巧,需要具体代码示例随着互联网的发展和人工智能技术的进步,自然语言处理(NaturalLanguageProcessing,NLP)成为了计算机科学中一个重要的研究方向。自然语言处理的目标是让计算机能够理解、解释和生成自然语言,使得人与机器之间的交流更加便捷和智能化。在自然语言处理中,文本检索是一个非常重要

Sphinx 分布式搜索的 PHP 实现方法解析Sphinx 分布式搜索的 PHP 实现方法解析Oct 03, 2023 am 08:49 AM

Sphinx分布式搜索的PHP实现方法解析引言:在当今互联网时代,搜索引擎已经成为人们获取信息的主要方式之一。为了提供更高效、更准确的搜索结果,一些大规模的网站或应用程序通常会使用分布式搜索引擎来处理搜索请求。Sphinx是一种知名的分布式搜索引擎,具有良好的性能和扩展性。本文将介绍如何使用PHP实现Sphinx分布式搜索,并提供具体的代码示

Sphinx 实现 PHP 项目的快速搜索与缓存优化Sphinx 实现 PHP 项目的快速搜索与缓存优化Oct 03, 2023 am 09:01 AM

Sphinx是一款开源的全文搜索引擎,它能够快速地处理大量的数据并提供高效的搜索功能。在PHP项目中使用Sphinx,可以实现快速的搜索和缓存优化,提升项目的性能和用户体验。本文将介绍如何在PHP项目中集成Sphinx,并通过具体的代码示例来说明其使用方法和优势。一、Sphinx的安装与配置要使用Sphinx,首先需要在服务器上进行安装并进

Sphinx PHP 在电商网站中的商品搜索与排序优化Sphinx PHP 在电商网站中的商品搜索与排序优化Oct 03, 2023 am 10:53 AM

SphinxPHP在电商网站中的商品搜索与排序优化在电商网站中,商品的搜索与排序是用户体验和销售转化的重要因素之一。为了提高用户的搜索体验和呈现与用户需求最匹配的结果,SphinxPHP是一款非常强大且广泛应用的全文搜索引擎。本文将介绍如何利用SphinxPHP在电商网站中进行商品搜索与排序优化,并提供具体的代码示例。一、安装和配置Sphin

如何在ThinkPHP6中使用Sphinx进行全文搜索?如何在ThinkPHP6中使用Sphinx进行全文搜索?Jun 12, 2023 pm 12:40 PM

在现代的Web开发中,搜索引擎已经成为了一个不可或缺的部分。与其它搜索引擎相比,Sphinx是一种专门用来处理全文搜索的服务。在本文中,我们将详细介绍如何在ThinkPHP6中集成Sphinx进行全文搜索。安装Sphinx首先,我们需要在服务器上安装Sphinx。以下是在Ubuntu系统上安装Sphinx的示例命令:$sudoap

See all articles

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment