Prerequisites

Before you begin this guide, you must have the followings.

Ubuntu server with sudo access Pre installed MySQL server

Step 1 — Install Sphinx

Installing Sphinx on Ubuntu is easy because it’s in the native package repository. Install it using the apt-get package manager on your Ubuntu system.

Step 2 – Import MySQL Database

Let’s import the sample SQL file into the database.First, create a database named test in your MySQL server, after that restore the database provided by the sphinx search package.

Step 3 – Configure Sphinx

Edit sphinx configuration as below and edit for the MySQL connection configuration as showing below.

Step 4 – Running Indexer

Run the indexer to create the full-text index from your data. The indexer is the first of the two principal tools as part of Sphinx. It works for gathering the data that will be searchable. You will see the results like below.

Step 5 – Starting Sphinx

Also, configure you Sphinx server to auto start on system boot. Use below command to set START to yes. Now also start service for the first time and check the status. You can also configure the indexer in your crontab to run it on a regular interval. The below crontab will run on every hour.

Step 6 – Working with Sphinx

Let’s execute some queries on your Sphinx server. First connect to Sphinx MySQL server using the following ocmmand. Now run one by one command below and see the changes. This is for your own learning only.