Version at: 24/01/2015, 15:13 vs. version at: 22/10/2016, 19:54
11Execute these instructions after you have followed the other instructions for [setting up a development virtual machine](install-tatoeba-on-vm). It is assumed that you have already installed libpq5.
22
33##Installing Sphinx on the VM
44
55* Download the latest version of Sphinx (starting out as the ordinary tatoeba user, not superuser):
66
77<pre>
88$ mkdir ~/downloads
99$ cd ~/downloads/
1010$ wget http://sphinxsearch.com/files/sphinxsearch\_2.1.5-release-1~wheezy\_i386.deb
1111$ su -
1212$ dpkg -i sphinxsearch_2.1.5-release-1~wheezy_i386.deb
1313$ exit
1414</pre>
1515
1616* Now make the Sphinx directory and subdirectories:
1717<pre>
1818$ mkdir ~/sphinx
1919$ cd ~/sphinx
2020$ mkdir indices
2121$ mkdir log
2222</pre>
2323
2424* Edit `docs/generate_sphinx_conf.php` as follows:
2525<pre>
2626 line 15
2727 $sourcePath = "/home/tatoeba/sphinx/indices";
2828 line 193-196:
2929 - sql_user = root
3030 - sql_pass = tatoeba
3131 - sql_db = tatoeba
3232 - sql_sock = /var/run/mysqld/mysqld.sock
3333 line 383:
3434 - change `port` to `listen` because the latest sphinx version uses `listen` instead of `port`.
3535 line 384, 385, 388:
3636 - log = /home/tatoeba/sphinx/log/searchd.log
3737 - query_log = /home/tatoeba/sphinx/log/query.log
3838 - pid_file = /home/tatoeba/sphinx/log/searchd.pid
3939</pre>
4040
4141* Generate the `sphinx.conf` file:
4242<pre>
4343$ php generate\_sphinx\_conf.php > sphinx.conf
4444</pre>
4545
4646* As superuser, copy `sphinx.conf` to sphinxsearch, index, and run the service:
4747
4848<pre>
4949$ su
5050$ cp sphinx.conf /etc/sphinxsearch/
5151$ indexer --all
5252$ searchd
5353$ exit
5454</pre>
5555
5656* If you want to stop the service, execute:
5757
5858<pre>
5959service sphinxsearch stop
6060</pre>
61
62Note that every time you add new sentences, you need to index. As long as they are not indexed, the search engine is not aware of their existence. Indexation doesn't happen on the fly. On Tatoeba's server, sentences are indexed every 15 minutes or so, with a cron job. On your local machine, they are not. However, you can run the indexation manually. There are two types of index: the main index and the delta index. As long as you're not dealing with more than a few thousand sentences, you don't need the delta index.
diff view generated by jsdifflib

Version at: 24/01/2015, 15:13

Execute these instructions after you have followed the other instructions for [setting up a development virtual machine](install-tatoeba-on-vm). It is assumed that you have already installed libpq5.

##Installing Sphinx on the VM

* Download the latest version of Sphinx (starting out as the ordinary tatoeba user, not superuser):

<pre>
$ mkdir ~/downloads
$ cd ~/downloads/
$ wget http://sphinxsearch.com/files/sphinxsearch\_2.1.5-release-1~wheezy\_i386.deb
$ su -
$ dpkg -i sphinxsearch_2.1.5-release-1~wheezy_i386.deb
$ exit 
</pre>

* Now make the Sphinx directory and subdirectories:
<pre>
$ mkdir ~/sphinx
$ cd ~/sphinx
$ mkdir indices
$ mkdir log
</pre>

* Edit `docs/generate_sphinx_conf.php` as follows:
<pre>
    line 15
        $sourcePath = "/home/tatoeba/sphinx/indices";
    line 193-196:
        - sql_user = root
        - sql_pass = tatoeba
        - sql_db = tatoeba
        - sql_sock = /var/run/mysqld/mysqld.sock
    line 383:
        - change `port` to `listen` because the latest sphinx version uses `listen` instead of `port`.
    line 384, 385, 388:
        - log = /home/tatoeba/sphinx/log/searchd.log
        - query_log = /home/tatoeba/sphinx/log/query.log
        - pid_file = /home/tatoeba/sphinx/log/searchd.pid
</pre>

* Generate the `sphinx.conf` file:
<pre>
$ php generate\_sphinx\_conf.php > sphinx.conf
</pre>

* As superuser, copy `sphinx.conf` to sphinxsearch, index, and run the service:

<pre>
$ su 
$ cp sphinx.conf /etc/sphinxsearch/
$ indexer --all
$ searchd
$ exit
</pre>

* If you want to stop the service, execute:

<pre>
service sphinxsearch stop
</pre>

version at: 22/10/2016, 19:54

Execute these instructions after you have followed the other instructions for [setting up a development virtual machine](install-tatoeba-on-vm). It is assumed that you have already installed libpq5.

##Installing Sphinx on the VM

* Download the latest version of Sphinx (starting out as the ordinary tatoeba user, not superuser):

<pre>
$ mkdir ~/downloads
$ cd ~/downloads/
$ wget http://sphinxsearch.com/files/sphinxsearch\_2.1.5-release-1~wheezy\_i386.deb
$ su -
$ dpkg -i sphinxsearch_2.1.5-release-1~wheezy_i386.deb
$ exit 
</pre>

* Now make the Sphinx directory and subdirectories:
<pre>
$ mkdir ~/sphinx
$ cd ~/sphinx
$ mkdir indices
$ mkdir log
</pre>

* Edit `docs/generate_sphinx_conf.php` as follows:
<pre>
    line 15
        $sourcePath = "/home/tatoeba/sphinx/indices";
    line 193-196:
        - sql_user = root
        - sql_pass = tatoeba
        - sql_db = tatoeba
        - sql_sock = /var/run/mysqld/mysqld.sock
    line 383:
        - change `port` to `listen` because the latest sphinx version uses `listen` instead of `port`.
    line 384, 385, 388:
        - log = /home/tatoeba/sphinx/log/searchd.log
        - query_log = /home/tatoeba/sphinx/log/query.log
        - pid_file = /home/tatoeba/sphinx/log/searchd.pid
</pre>

* Generate the `sphinx.conf` file:
<pre>
$ php generate\_sphinx\_conf.php > sphinx.conf
</pre>

* As superuser, copy `sphinx.conf` to sphinxsearch, index, and run the service:

<pre>
$ su 
$ cp sphinx.conf /etc/sphinxsearch/
$ indexer --all
$ searchd
$ exit
</pre>

* If you want to stop the service, execute:

<pre>
service sphinxsearch stop
</pre>

Note that every time you add new sentences, you need to index. As long as they are not indexed, the search engine is not aware of their existence. Indexation doesn't happen on the fly. On Tatoeba's server, sentences are indexed every 15 minutes or so, with a cron job. On your local machine, they are not. However, you can run the indexation manually. There are two types of index: the main index and the delta index. As long as you're not dealing with more than a few thousand sentences, you don't need the delta index.

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.