<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linu &#8211; Hostry Help Center</title>
	<atom:link href="https://help.hostry.com/article-tags/linu/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.hostry.com</link>
	<description>Full information on how to use HOSTRY, provided by 24/7 community based support</description>
	<lastBuildDate>Tue, 06 Aug 2019 06:58:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.13</generator>

<image>
	<url>https://help.hostry.com/wp-content/uploads/cache/2021/01/cropped-apple-icon-180x180-1/836712163.png</url>
	<title>Linu &#8211; Hostry Help Center</title>
	<link>https://help.hostry.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How To Install And Configure Sphinx on Linux</title>
		<link>https://help.hostry.com/knowledge-base/how-to-install-sphinx/</link>
					<comments>https://help.hostry.com/knowledge-base/how-to-install-sphinx/#comments</comments>
		
		<dc:creator><![CDATA[Paul Harris]]></dc:creator>
		<pubDate>Fri, 26 Jul 2019 10:26:54 +0000</pubDate>
				<guid isPermaLink="false">https://help.hostry.com/?post_type=ht_kb&#038;p=409</guid>

					<description><![CDATA[For Debian-based systems, run the following commands: user@localhost: ~ sudo apt update Optional: user@localhost: ~ sudo apt upgrade user@localhost: ~ sudo apt install user@localhost: ~ sudo apt install sphinxsearch For RedHat/CenoOS: user@localhost: ~ sudo yum install -y postgresql-libs unixODBC user@localhost: ~ cd /tmp user@localhost: ~ wget http://sphinxsearch.com/files/sphinx-2.2.11-1.rhel7.x86_64.rpm user@localhost: ~ sudo [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>For Debian-based systems, run the following commands:</p>



<p><code>user@localhost: ~ sudo apt update</code></p>



<p>Optional:</p>



<p><code>user@localhost: ~ sudo apt upgrade</code></p>



<p><code>user@localhost: ~ sudo apt install  </code></p>



<p><code>user@localhost: ~ sudo apt install sphinxsearch</code></p>



<p><strong>For RedHat/CenoOS:</strong></p>



<p><code>user@localhost: ~ sudo yum install -y postgresql-libs unixODBC</code></p>



<p><code>user@localhost: ~ cd /tmp</code></p>



<p><code>user@localhost: ~ wget http://sphinxsearch.com/files/sphinx-2.2.11-1.rhel7.x86_64.rpm</code></p>



<p><code>user@localhost: ~ sudo yum install -y ./sphinx-2.2.11-1.rhel7.x86_64.rpm</code></p>



<h2 id="security-settings" >Security settings</h2>



<p>We close access from the outside:In <strong>/etc/sphinxsearch/sphinx.conf</strong> write on all listen. CentOS is a directory <strong>/etc/sphinx/ Sphinx instead</strong>. Leave only: <strong>listen = 127.0.0.1:9312 (</strong>or any other desired address)</p>



<h2 id="indexconfiguration" >Index
configuration</h2>



<p>The index is configured individually for each project in the <strong>/etc/sphinxsearch/sphinx file.conf</strong></p>



<p>Sphinx
uses two concepts:</p>



<ul><li>source &#8211; where to get the data.</li><li>index &#8211; index parameters.</li><li>Index is always tied to some source. Source can be inherited</li></ul>



<p>Ideal to do so:</p>



<p>The source from which the other sources will be inherited. It will describe the parameters of connection to the database server. Source <strong>main_src</strong></p>



<p><code>{</code></p>



<p><code>type = mysql</code></p>



<p><code>sql_host = localhost</code></p>



<p><code>sql_user = root</code></p>



<p><code>sql_pass = WERY_WERY_STRONG_PASSWORD</code></p>



<p><code>}</code></p>



<p>  Source, which will determine the connection to a particular database</p>



<p><code>source &lt;database_name&gt; : main_src  </code></p>



<p><code>{</code></p>



<p><code>sql_db = &lt;database_name&gt;</code></p>



<p><code>sql_query_pre = SET NAMES utf8</code></p>



<p><code>sql_query_pre = SET collation_connection = 'utf8_unicode_ci'</code></p>



<p><code>}</code></p>



<p>source, which determines the data source (here already applied to the structure of the database itself)</p>



<p><code>source &lt;source_name&gt; : &lt;database_name&gt;</code></p>



<p><code>{</code></p>



<p><code>sql_query_pre = SET @id := 0</code></p>



<p><code>sql_query = \</code></p>



<p><code>SELECT @id := @id + 1 as id, name, properties, price, description \</code></p>



<p><code>FROM products \</code></p>



<p><code>WHERE active = 1</code></p>



<p><code>sql_field_string = name</code></p>



<p><code>sql_field_string = properties</code></p>



<p><code>sql_attr_string = name</code></p>



<p><code>sql_attr_string = description</code></p>



<p><code>sql_attr_float = price</code></p>



<p><code>}</code></p>



<h2 id="define-index-based-on-the-source" >Define index based on the source</h2>



<p><code>ndex &lt;source_name&gt;</code></p>



<p><code>{</code></p>



<p><code>source = &lt;source_name&gt;</code></p>



<p><code>path = /var/www/sphinxsearch/data/&lt;source_name&gt;</code></p>



<p><code>morphology = none #stem_enru, soundex, methaphone</code></p>



<p><code>min_infix_len = 2</code></p>



<p><code>}</code></p>



<p>For more customization you need to study the documentation to Sphinx: <a href="http://sphinxsearch.com/docs/current.html">http://sphinxsearch.com/docs/current.html </a></p>



<h2 id="to-reindex-the-data" >To reindex the data</h2>



<p><strong><em>indexer -c /etc/sphinxsearch/sphinx.conf &#8211;rotate &lt;source_name&gt;</em></strong></p>



<h2 id="to-configure-a-regular-reindex" >To configure a regular reindex</h2>



<p>In
the process of changing data in MySQL tables, you need to re-index
them. 
</p>



<p>To do this, the indexer command from step 3 must be added to the crown with the frequency that suits you.</p>



<p><code>user@localhost: ~ sudo contab -e  </code></p>



<p><strong>0 */4 * * * indexer -c /etc/sphinxsearch/sphinx.conf &#8211;rotate &lt;source_name&gt;</strong></p>



<p>Ideally,
use real-time indexes, then the need for regular reindexing will
disappear and you can not add a job to cronra</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://help.hostry.com/knowledge-base/how-to-install-sphinx/feed/</wfw:commentRss>
			<slash:comments>462</slash:comments>
		
		
			</item>
	</channel>
</rss>
