How To Install sphinx on CentOS 8

sphinx is Free open-source SQL full-text search engine

Introduction

In this tutorial we learn how to install sphinx on CentOS 8.

What is sphinx

Sphinx is a full-text search engine, distributed under GPL version 2. Commercial licensing (e.g. for embedded use) is also available upon request. Generally, it’s a standalone search engine, meant to provide fast, size-efficient and relevant full-text search functions to other applications. Sphinx was specially designed to integrate well with SQL databases and scripting languages. Currently built-in data source drivers support fetching data either via direct connection to MySQL, or PostgreSQL, or from a pipe in a custom XML format. Adding new drivers (e.g. native support other DBMSes) is designed to be as easy as possible. Search API native ported to PHP, Python, Perl, Ruby, Java, and also available as a plug-gable MySQL storage engine. API is very lightweight so porting it to new language is known to take a few hours. As for the name, Sphinx is an acronym which is officially decoded as SQL Phrase Index. Yes, I know about CMU’s Sphinx project.

We can use yum or dnf to install sphinx on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install sphinx.

Install sphinx on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install sphinx using dnf by running the following command:

sudo dnf -y install sphinx

Install sphinx on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install sphinx using yum by running the following command:

sudo yum -y install sphinx

How To Uninstall sphinx on CentOS 8

To uninstall only the sphinx package we can use the following command:

sudo dnf remove sphinx

sphinx Package Contents on CentOS 8

/etc/logrotate.d/sphinx
/etc/sphinx
/etc/sphinx/sphinx.conf
/usr/bin/indexer
/usr/bin/indextool
/usr/bin/searchd
/usr/bin/spelldump
/usr/bin/wordbreaker
/usr/lib/.build-id
/usr/lib/.build-id/00
/usr/lib/.build-id/00/ab8cb7713c394664b66c3ca6425ad6f2666496
/usr/lib/.build-id/0e
/usr/lib/.build-id/0e/e8de9786d066f7bc92301da2fa029ee43bf6b4
/usr/lib/.build-id/32
/usr/lib/.build-id/32/439b719ee1a17cf77bc03d20b623c95e116e16
/usr/lib/.build-id/a6
/usr/lib/.build-id/a6/3430c82bb5fd636dca665dc93e7d80a8e8d6f6
/usr/lib/.build-id/f6
/usr/lib/.build-id/f6/12866853fdb40afc48099bfccbdb4dd651eae7
/usr/lib/systemd/system/searchd.service
/usr/lib/tmpfiles.d/sphinx.conf
/usr/share/doc/sphinx
/usr/share/doc/sphinx/COPYING
/usr/share/doc/sphinx/example.sql
/usr/share/doc/sphinx/sphinx-min.conf.dist
/usr/share/doc/sphinx/sphinx.conf.dist
/usr/share/doc/sphinx/sphinx.txt
/usr/share/man/man1/indexer.1.gz
/usr/share/man/man1/indextool.1.gz
/usr/share/man/man1/searchd.1.gz
/usr/share/man/man1/spelldump.1.gz
/var/lib/sphinx
/var/log/sphinx
/var/run/sphinx

References

Summary

In this tutorial we learn how to install sphinx on CentOS 8 using yum and dnf.