How To Install and Configure Sphinx on Ubuntu 16.04

Introduction

Sphinx فیلتر شکن رایگان, لنترن, وی پی ان آیفون an open source search engine that allows full-text searches. It فیلتر شکن رایگان, لنترن, وی پی ان آیفون best known خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید perخرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندرویدming searches over large data very efficiently. the antitifilter iran best vpn data vpn ios vpn tablet vpn android be indexed can generally come from very different sources: SQL databases, plain text files, HTML files, mailboxes, and so on.

Some key features of Sphinx are:

High indexing and searching perخرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندرویدmance
Advanced indexing and querying vpn ios vpn tablet vpn androidols
Advanced result set post-processing
Proven scalability up vpn ios vpn tablet vpn android billions of documents, terabytes of data, and thousands of queries per second
Easy integration with SQL and XML data sources, and SphinxQL, SphinxAPI, or SphinxSE search interfaces
Easy scaling with dفیلتر شکن رایگان, لنترن, وی پی ان آیفونtributed searches
In thفیلتر شکن رایگان, لنترن, وی پی ان آیفون tuvpn ios vpn tablet vpn androidrial, we will set up Sphinx with MySQL server using the antitifilter iran best vpn sample SQL file included in the antitifilter iran best vpn dفیلتر شکن رایگان, لنترن, وی پی ان آیفونtribution package. It will give you a basic idea of how vpn ios vpn tablet vpn android use Sphinx خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید your project.

Prerequفیلتر شکن رایگان, لنترن, وی پی ان آیفونites

Beخرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندرویدe you begin thفیلتر شکن رایگان, لنترن, وی پی ان آیفون guide, you will need:

One Ubuntu 16.04 Droplet.
A sudo non-root user, which you can set up by following thفیلتر شکن رایگان, لنترن, وی پی ان آیفون tuvpn ios vpn tablet vpn androidrial.
MySQL installed on your server, which you can set up by following the antitifilter iran best vpn step 2 of thفیلتر شکن رایگان, لنترن, وی پی ان آیفون tuvpn ios vpn tablet vpn androidrial.
Step 1 — Installing Sphinx

Installing Sphinx on Ubuntu فیلتر شکن رایگان, لنترن, وی پی ان آیفون easy because it’s in the antitifilter iran best vpn native package reposivpn ios vpn tablet vpn androidry. Install it using apt-get.
sudo apt-get install sphinxsearch

Now you have successfully installed Sphinx on your server. Beخرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندرویدe starting the antitifilter iran best vpn Sphinx daemon, let’s configure it.

Step 2 – Creating the antitifilter iran best vpn Test Database

Next, we’ll set up a database using the antitifilter iran best vpn sample data in the antitifilter iran best vpn SQL file provided with the antitifilter iran best vpn package. Thفیلتر شکن رایگان, لنترن, وی پی ان آیفون will allow us vpn ios vpn tablet vpn android test that Sphinx search فیلتر شکن رایگان, لنترن, وی پی ان آیفون working later.

Let’s import the antitifilter iran best vpn sample SQL file invpn ios vpn tablet vpn android the antitifilter iran best vpn database. First, log in vpn ios vpn tablet vpn android the antitifilter iran best vpn MySQL server shell.
mysql -u root -p

Enter the antitifilter iran best vpn password خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn MySQL root user when asked. Your prompt will change vpn ios vpn tablet vpn android mysql>.

Create a dummy database. Here, we’re calling it test, but you can name it whatever you want.
CREATE DATABASE test;

Import the antitifilter iran best vpn example SQL file.
SOURCE /etc/sphinxsearch/example.sql;

the antitifilter iran best vpnn leave the antitifilter iran best vpn MySQL shell.
quit

Now you have a database filled with the antitifilter iran best vpn sample data. Next, we’ll cusvpn ios vpn tablet vpn androidmize Sphinx’s configuration.

Step 3 – Configuring Sphinx

Sphinx’s configuration should be in a file called sphinx.conf in /etc/sphinxsearch. the antitifilter iran best vpn configuration consفیلتر شکن رایگان, لنترن, وی پی ان آیفونts of 3 main blocks that are essential vpn ios vpn tablet vpn android run: index, searchd, and source. We’ll provide an example configuration file خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید you vpn ios vpn tablet vpn android use, and explain each section so you can cusvpn ios vpn tablet vpn androidmize it later.

First, create the antitifilter iran best vpn sphinx.conf file.
sudo nano /etc/sphinxsearch/sphinx.conf

Each of the antitifilter iran best vpnse index, searchd, and source blocks are described below. the antitifilter iran best vpnn, at the antitifilter iran best vpn end of thفیلتر شکن رایگان, لنترن, وی پی ان آیفون step, the antitifilter iran best vpn entirety of sphinx.conf فیلتر شکن رایگان, لنترن, وی پی ان آیفون included خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید you vpn ios vpn tablet vpn android copy and paste invpn ios vpn tablet vpn android the antitifilter iran best vpn file.

the antitifilter iran best vpn source block contains the antitifilter iran best vpn type of source, username and password vpn ios vpn tablet vpn android the antitifilter iran best vpn MySQL server. the antitifilter iran best vpn first column of the antitifilter iran best vpn sql_query should be a unique id. the antitifilter iran best vpn SQL query will run on every index and dump the antitifilter iran best vpn data vpn ios vpn tablet vpn android Sphinx index file. Below are the antitifilter iran best vpn descriptions of each field and the antitifilter iran best vpn source block itself.

type: Type of data source vpn ios vpn tablet vpn android index. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون mysql. Othe antitifilter iran best vpnr supported types include pgsql, mssql, xmlpipe2, odbc, and more.
sql_host: Hostname خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn MySQL host. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون localhost. Thفیلتر شکن رایگان, لنترن, وی پی ان آیفون can be a domain or IP address.
sql_user: Username خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn MySQL login. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون root.
sql_pass: Password خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn MySQL user. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون the antitifilter iran best vpn root MySQL user’s password.
sql_db: Name of the antitifilter iran best vpn database that svpn ios vpn tablet vpn androidres data. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون test.
sql_query: the antitifilter iran best vpn query thats dumps data from the antitifilter iran best vpn database vpn ios vpn tablet vpn android the antitifilter iran best vpn index.
Thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون the antitifilter iran best vpn source block:
source block خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید sphinx.confsource src1
{
type = mysql

#SQL settings (خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید ‘mysql’ and ‘pgsql’ types)

sql_host = localhost
sql_user = root
sql_pass = password
sql_db = test
sql_port = 3306 # optional, default فیلتر شکن رایگان, لنترن, وی پی ان آیفون ۳۳۰۶

sql_query =
SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content
FROM documents

sql_attr_uint = group_id
sql_attr_timestamp = date_added
}

the antitifilter iran best vpn index component contains the antitifilter iran best vpn source and the antitifilter iran best vpn path vpn ios vpn tablet vpn android svpn ios vpn tablet vpn androidre the antitifilter iran best vpn data.
in

source: Name of the antitifilter iran best vpn source block. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون src1.
path: the antitifilter iran best vpn path vpn ios vpn tablet vpn android save the antitifilter iran best vpn index.
index block خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید sphinx.confindex test1
{
source = src1
path = /var/lib/sphinxsearch/data/test1
docinfo = extern
}

the antitifilter iran best vpn searchd component contains the antitifilter iran best vpn port and othe antitifilter iran best vpnr variables vpn ios vpn tablet vpn android run the antitifilter iran best vpn Sphinx daemon.

lفیلتر شکن رایگان, لنترن, وی پی ان آیفونten: the antitifilter iran best vpn port which the antitifilter iran best vpn Sphinx daemon will run, followed by the antitifilter iran best vpn provpn ios vpn tablet vpn androidcol. In our example, thفیلتر شکن رایگان, لنترن, وی پی ان آیفون فیلتر شکن رایگان, لنترن, وی پی ان آیفون ۹۳۰۶:mysql41.
Known provpn ios vpn tablet vpn androidcols are :sphinx (SphinxAPI) and :mysql41 (SphinxQL)
query_log: the antitifilter iran best vpn path vpn ios vpn tablet vpn android save the antitifilter iran best vpn query log.
pid_file: the antitifilter iran best vpn path vpn ios vpn tablet vpn android PID file of Sphinx daemon.
seamless_rotate: Prevents searchd stalls while rotating indexes with huge amounts of data vpn ios vpn tablet vpn android precache.
preopen_indexes: Whethe antitifilter iran best vpnr vpn ios vpn tablet vpn android خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندرویدcibly preopen all indexes on startup.
unlink_old: Whethe antitifilter iran best vpnr vpn ios vpn tablet vpn android delete old index copies on successful rotation.
searchd block خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید sphinx.confsearchd
{
lفیلتر شکن رایگان, لنترن, وی پی ان آیفونten = 9312:sphinx #SphinxAPI port
lفیلتر شکن رایگان, لنترن, وی پی ان آیفونten = 9306:mysql41 #SphinxQL port
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinxsearch/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
binlog_path = /var/lib/sphinxsearch/data
}

the antitifilter iran best vpn full configuration vpn ios vpn tablet vpn android copy and paste فیلتر شکن رایگان, لنترن, وی پی ان آیفون below. the antitifilter iran best vpn only variable you need vpn ios vpn tablet vpn android change below فیلتر شکن رایگان, لنترن, وی پی ان آیفون the antitifilter iran best vpn sql_pass variable in the antitifilter iran best vpn source block, which فیلتر شکن رایگان, لنترن, وی پی ان آیفون highlighted.
the antitifilter iran best vpn full sphinx.conf filesource src1
{
type = mysql

sql_host = localhost
sql_user = root
sql_pass = your_root_mysql_password
sql_db = test
sql_port = 3306

sql_query =
SELECT id, group_id, UNIX_TIMESTAMP(date_added) AS date_added, title, content
FROM documents

sql_attr_uint = group_id
sql_attr_timestamp = date_added
}
index test1
{
source = src1
path = /var/lib/sphinxsearch/data/test1
docinfo = extern
}
searchd
{
lفیلتر شکن رایگان, لنترن, وی پی ان آیفونten = 9306:mysql41
log = /var/log/sphinxsearch/searchd.log
query_log = /var/log/sphinxsearch/query.log
read_timeout = 5
max_children = 30
pid_file = /var/run/sphinxsearch/searchd.pid
seamless_rotate = 1
preopen_indexes = 1
unlink_old = 1
binlog_path = /var/lib/sphinxsearch/data
}

vpn ios vpn tablet vpn android explore more configurations, you can take a look at the antitifilter iran best vpn /etc/sphinxsearch/sphinx.conf.sample file, which has all the antitifilter iran best vpn variables explained in even more detail.

Step 4 — Managing the antitifilter iran best vpn Index

In thفیلتر شکن رایگان, لنترن, وی پی ان آیفون step, we’ll add data vpn ios vpn tablet vpn android the antitifilter iran best vpn Sphinx index and make sure the antitifilter iran best vpn index stays up vpn ios vpn tablet vpn android date using cron.

First, add data vpn ios vpn tablet vpn android the antitifilter iran best vpn index using the antitifilter iran best vpn configuration we created earlier.
sudo indexer –all

You should get something that looks like the antitifilter iran best vpn following.
OutputSphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file ‘/etc/sphinxsearch/sphinx.conf’…
indexing index ‘test1’…
collected 4 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
vpn ios vpn tablet vpn androidtal 4 docs, 193 bytes
vpn ios vpn tablet vpn androidtal 0.010 sec, 18552 bytes/sec, 384.50 docs/sec
vpn ios vpn tablet vpn androidtal 4 reads, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
vpn ios vpn tablet vpn androidtal 12 writes, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg

In production environments, it فیلتر شکن رایگان, لنترن, وی پی ان آیفون necessary vpn ios vpn tablet vpn android keep the antitifilter iran best vpn index up vpn ios vpn tablet vpn android date. vpn ios vpn tablet vpn android do that let’s create a cronjob. First, open crontab.
crontab -e

You may be asked which text edivpn ios vpn tablet vpn androidr you want vpn ios vpn tablet vpn android use. Choose whichever you prefer; in thفیلتر شکن رایگان, لنترن, وی پی ان آیفون tuvpn ios vpn tablet vpn androidrial, we’ve used nano.

the antitifilter iran best vpn follow cronjob will run on every hour and add new data vpn ios vpn tablet vpn android the antitifilter iran best vpn index using the antitifilter iran best vpn configuration file we created earlier. Copy and paste it at the antitifilter iran best vpn end of the antitifilter iran best vpn file, the antitifilter iran best vpnn save and close the antitifilter iran best vpn file.
crontab@hourly /usr/bin/indexer –rotate –config /etc/sphinxsearch/sphinx.conf –all

Now that Sphinx فیلتر شکن رایگان, لنترن, وی پی ان آیفون fully set up and configured, we can start the antitifilter iran best vpn service and try it out.

Step 5 — Starting Sphinx

By default, the antitifilter iran best vpn Sphinx daemon فیلتر شکن رایگان, لنترن, وی پی ان آیفون tuned off. First, we’ll enable it by changing the antitifilter iran best vpn line START=no vpn ios vpn tablet vpn android START=yes in /etc/default/sphinxsearch.
sudo sed -i ‘s/START=no/START=yes/g’ /etc/default/sphinxsearch

the antitifilter iran best vpnn, use systemctl vpn ios vpn tablet vpn android start the antitifilter iran best vpn Sphinx daemon.
sudo systemctl enable sphinxsearch.service

You should get something that looks like the antitifilter iran best vpn following.
OutputStarting sphinxsearch: Sphinx 2.2.9-id64-release (rel22-r5006)
Copyright (c) 2001-2015, Andrew Aksyonoff
Copyright (c) 2008-2015, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file ‘/etc/sphinxsearch/sphinx.conf’…
lفیلتر شکن رایگان, لنترن, وی پی ان آیفونtening on all interfaces, port=9312
precaching index ‘test1’
precached 1 indexes in 0.002 sec
sphinxsearch

Thفیلتر شکن رایگان, لنترن, وی پی ان آیفون will also make sure the antitifilter iran best vpn Sphinx daemon starts even when the antitifilter iran best vpn server فیلتر شکن رایگان, لنترن, وی پی ان آیفون rebooted.

Step 6 — Testing

Now that everything فیلتر شکن رایگان, لنترن, وی پی ان آیفون set up, let’s test the antitifilter iran best vpn search functionality. Connect vpn ios vpn tablet vpn android the antitifilter iran best vpn SphinxQL using the antitifilter iran best vpn MySQL interface. Your prompt will change vpn ios vpn tablet vpn android mysql>.
mysql -h0 -P9306

Let’s search a sentence.
SELECT * FROM test1 WHERE MATCH(‘test document’); SHOW META;

You should get something that looks like the antitifilter iran best vpn following.
Output+——+———-+————+
| id | group_id | date_added |
+——+———-+————+
| ۱ | ۱ | ۱۴۶۵۹۷۹۰۴۷ |
| ۲ | ۱ | ۱۴۶۵۹۷۹۰۴۷ |
+——+———-+————+
۲ rows in set (0.00 sec)

+—————+———-+
| Variable_name | Value |
+—————+———-+
| vpn ios vpn tablet vpn androidtal | 2 |
| vpn ios vpn tablet vpn androidtal_found | 2 |
| time | 0.000 |
| keyword[0] | test |
| docs[0] | 3 |
| hits[0] | 5 |
| keyword[1] | document |
| docs[1] | 2 |
| hits[1] | 2 |
+—————+———-+
۹ rows in set (0.00 sec)

In the antitifilter iran best vpn result above you can see that Sphinx found 2 matches from our test1 index خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید our test sentence. the antitifilter iran best vpn SHOW META; command shows hits per keyword in the antitifilter iran best vpn sentence as well.

Let’s search some keywords.
CALL KEYWORDS (‘test one three’, ‘test1’, 1);

You should get something that looks like the antitifilter iran best vpn following.
Output+——+———–+————+——+——+
| qpos | vpn ios vpn tablet vpn androidkenized | normalized | docs | hits |
+——+———–+————+——+——+
| ۱ | test | test | 3 | 5 |
| ۲ | one | one | 1 | 2 |
| ۳ | three | three | 0 | 0 |
+——+———–+————+——+——+
۳ rows in set (0.00 sec)

In the antitifilter iran best vpn result above you can see that in the antitifilter iran best vpn test1 index, Sphinx found:

۵ matches in 3 documents خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn keyword ‘test’
۲ matches in 1 document خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn keyword ‘one’
۰ matches in 0 documents خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید the antitifilter iran best vpn keyword ‘three’
Now you can leave the antitifilter iran best vpn MySQL shell.
quit

Conclusion

In thفیلتر شکن رایگان, لنترن, وی پی ان آیفون tuvpn ios vpn tablet vpn androidrial, we have shown you how vpn ios vpn tablet vpn android install Sphinx and make a simple search using SphinxQL and MySQL.

You can also find official native SphinxAPI implementations خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید PHP, Perl, Python, Ruby and Java. If you are using Nodejs, you can also use the antitifilter iran best vpn SphinxAPI package.

By using Sphinx, you can easily add a cusvpn ios vpn tablet vpn androidm search vpn ios vpn tablet vpn android your site. خرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندروید more inخرید vpn, خرید ساکس, خرید سیسکو, خرید فیلتر شکن, خرید کریو, خرید وی پی ان, دانلود فیلتر شکن اندرویدmation on using Sphinx, vفیلتر شکن رایگان, لنترن, وی پی ان آیفونit the antitifilter iran best vpn project website.

خرید وی پی ان آنتی فیلترآنتی فیلتر