KVS and Sphinx Integration

You may want to integrate Sphinx into your KVS-powered site to improve video search, fine-tune your copy of KVS, and reduce server load. Sphinx requires a minimal amount of server resources and is therefore recommended for traffic-heavy sites.

What are the advantages of Sphinx?

- Fast indexing (for 99% KVS sites, indexing takes seconds to tens of seconds).
- Fast search (up to 150-250 queries / second with 1,000,000 database items).
- Stop words.
- Morphological search: Sphinx has built-in modules for English, Russian, and Czech; modules for French, Spanish, Portuguese, Italian, Romanian, German, Dutch, Swedish, Norwegian, Danish, Finnish, and Hungarian are available.
- Custom filter groups.

Easy integration into KVS.

1. Server administrator needs to install sphinx.

2. Create a folder named sphinx_search in the admin folder and unpack the archive into it.

3. Add this data to your sphinx.conf file:
- MySQL credentials and details.
- Full server path to storage folders, in 4 places.

4. Run a SSH query of this type «indexer --config /PATH/admin/sphinx_search/sphinx.conf --all», replace «/PATH» to full server path to your admin folder.
If everything is correct, indexing will start, and in a few seconds you will see «collected 77000 docs, 20.0 MB».

5. After this, the search daemon can be launched with «searchd --config /PATH/admin/sphinx_search/sphinx.conf», to stop the daemon, enter «searchd --config /PATH/admin/sphinx_search/sphinx.conf --stop»

6. To make sure the Sphinx database is up to date, create an hourly CRON job with this string: «indexer --config /PATH/admin/sphinx_search/sphinx.conf --rotate --all».

7. To switch to Sphinx search in KVS, you need to configure the External Search plugin settings in the following way:
- Use external search: «Always».
- API: «http://domain.com/admin/sphinx_search/kvs_sphinx_search_videos.php?query=%QUERY%&from=%FROM%&limit=%LIMIT%».
- URL: «http://domain.com».

Currently only video search can be implemented in this simple way. Further on, we will add album search and related items for videos and albums via Sphinx.

Contact our support department via our ticket system if you want to have your copy of KVS customized so that search is fine-tuned using Sphinx.