Installation Instructions

Follow the Instructions to install sphinx. Only the actual installation is required, no need to follow "Sphinx Quick Usage Tour" for phpBB search. Sphinx Configuration

Sphinx configuration file data can either be generated through ACP and then copy pasted into the sphinx.conf or the Sphinx Sample Config can be manually edited and used. Following folders/files need to be created and defined in the sphinx.conf:

  • Config directory which will have sphinx.conf and stopwords.txt (If defined).

  • Data directory which will have binary and index files.

  • Log directory as a sub directory of Data directory which will save all logs related to sphinx search server. Creating Required Directories

  • Data directory

    mkdir -p {DATA_PATH}

  • Log directory

    mkdir -p {DATA_PATH}/log Indexing

Board administrator needs to select Sphinx Fulltext Search as the search backend and Create Search Index through the ACP UI. This will create a SPHINX_TABLE in the database. Then the sphinx indexer should be manually run from the shell.

  • Index Main

    indexer --config {CONFIG_PATH}/sphinx.conf index_phpbb_{SPHINX_ID}_main >> {DATA_PATH}/log/indexer.log 2>&1 &

  • Index Delta

    indexer --config {CONFIG_PATH}/sphinx.conf index_phpbb_{SPHINX_ID}_delta >> {DATA_PATH}/log/indexer.log 2>&1 &

  • Re-index

    indexer --rotate --config {CONFIG_PATH}/sphinx.conf index_phpbb_{SPHINX_ID}_delta >> {DATA_PATH}/log/indexer.log 2>&1 & Test Sphinx

Test whether sphinx is working. The following command will return the search result.

search --config {CONFIG_PATH}/sphinx.conf search string Incremental Updates

Crontab file on most Unix Systems can be edited by

crontab -e

Add this line to update the delta index every five minutes

*/5 * * * * indexer --rotate --config {CONFIG_PATH}/sphinx.conf index_phpbb_{SPHINX_ID}_delta >> {DATA_PATH}/log/indexer.log 2>&1 &

Add this line to set up cron job for full index once every night

0 3 * * * indexer --rotate --config {CONFIG_PATH}/sphinx.conf index_phpbb_{SPHINX_ID}_main >> {DATA_PATH}/log/indexer.log 2>&1 & Start Searchd

Start sphinx daemon.

searchd --config {CONFIG_PATH}/sphinx.conf >> {DATA_PATH}/log/searchd-startup.log 2>&1 & Troubleshooting

Log files present in the {DATA_PATH}/log/ directory can be checked for errors. See Sphinx Documentation for details.