Wednesday, April 24, 2013

How to install Sphinx in Fedora for Tiny Tiny RSS


The generic instructions can be found here:

Tiny Tiny RSS Wiki: SphinxSearch

sudo dnf install sphinx

Download the Fedora specific TTRSS configuration file for the database you are using here:

Fedora Sphinx (Pre-version 2.2.6) Configuration for Tiny Tiny RSS - PostgreSQL

Fedora Sphinx (Pre-version 2.2.6) Configuration for Tiny Tiny RSS - MariaDB

Fedora Sphinx Configuration for Tiny Tiny RSS - PostgreSQL

Fedora Sphinx Configuration for Tiny Tiny RSS - MariaDB

Place the above configuration file in /etc/sphinx as sphinx.conf - make the few necessary configuration changes to reflect how you created the PostgreSQL or MariaDB/MySQL database and you should be good to go.

Run the indexer to create the full-text index of the ttrss database:
sudo /usr/bin./indexer --all

Now enable the Sphinx searchd service:
sudo systemctl enable searchd.service

Now start the Sphinx searchd service:
sudo systemctl start searchd.service

Last but not least, modify your Tiny Tiny RSS configuration to activate Sphinx.  The configuration is located at:  /var/www/html/ttrss_directory/config.php
where ttrss_directory is the name you used, i.e. ttrss, rss, etc.

change:
define('SPHINX_ENABLED', false); to define('SPHINX_ENABLED', true);

Now setup automatic update of the search indexes:
sudo crontab -e
@daily /bin/indexer --rotate ttrss >/dev/null 2>&0 # Same as 0 0 * * *
*/20 * * * * /bin/indexer --rotate delta >/dev/null 2>&0 # Every 20 min


Write the file with :wq and you're done.