How to install Sphinx in Linux (Centos) ?

What is Sphinx and How to install Sphinx in Linux?

What is Sphinx?

It is used to search full-text search in different Data sources such as – SQL , plain text, HTML files etc.

It is Open-source that means – its free.

Usage

Used to provide rapid and high Quality of search result.
It is implemented with web applications.

Similarity
It is very similar to varnish

Below example will help you to know more about Sphinx and how to install it on your server.

Need to install Mysql before we start Sphinx installation

Mysql installation ( I prefer MariaDBsimilar to mysql)

sudo yum install mariadb-server

After installation Start mariadb sql

sudo systemctl start mariadb.service

Enable the Mariadb so that Mariadb starts on server reboot

sudo systemctl enable mariadb.service

Setup MariaDB server

mysql_secure_installation

Create one database and user



mysql -uroot

create database techouse;

create user 'techouse'@'localhsot' identified by 'techouse';

grant all on techouse.* to 'techouse'@'localhost';

use techouse;

source example.sql;

Download the version occuring to your requirements

http://sphinxsearch.com/downloads/release/

I will show you how to install sphinx with one example

http://sphinxsearch.com/downloads/sphinx-2.2.11-1.rhel7.src.rpm

INstall the downloaded package

yum install sphinx-2.2.11-1.rhel7.src.rpm

vim /etc/sphinx/sphinx.conf

Change the username and password according to your DB Details

sql_host = localhost
sql_user = test
sql_pass =
sql_db = test
sql_port = 3306 # optional, default is 3306

I am changing according to my DB

sql_user = techouse
sql_pass = techouse

 

sudo indexer --all
sudo searchd

python /usr/share/sphinx/api/test.py this is my test document

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.