To use the power of Sphinx for your WordPress blog, follow these steps: 1. Install the Sphinx Search plugin. 2. Install Sphinx on your web server. 3. Set up cron jobs to re-index your website periodically. 4. Configure the Sphinx Search plugin. 5. Customize your WordPress templates to show the Sphinx search field.
Install the Sphinx Search plugin: 1. Unpack the plugin archive to wp-content/plugins/sphinxsearch folder of your WordPress installation; 2. Activate SphinxSearch plugin via WordPress admin area; 3. Create "sphinx" directory outside of you document root 4. Chmod the "sphinx" directory to make it writeable for WordPress: e.g. chmod 777 sphinx (to make it writable for all).
Install Sphinx on your web server: If you haven't already installed Sphinx, you can install it automatically or manually: 1. For automatic installation go to 'WP-Admin -> Options -> SphinxSearch' and press "Install Personal Sphinx Search Engine"; 2. For manual installation - please visit http://www.sphinxsearch.com/ for more instructions. 3. After you have installed Sphinx manually change your sphinx.conf: In plugin folder sphinxsearch/rep you can find an example of sphinx.conf; Copy "source" and "index" sections to your sphinx.conf; In sphinx.conf replace our placeholders with their values depending on your system; 4. Go to "WP-Admin -> Options -> SphinxSearch" Add index configuration options and save the changes; 5. Run sphinx indexer; 6. Restart sphinx search daemon. 7. Chmod the searchd.pid file to make it readable for WordPress: e.g. chmod 644 searchd.pid (to make it readable for all).
Set up cron jobs to re-index your website periodically: 1. Copy cron/reindexconfigsample.php to cron/reindexconfig.php 2. Open reindexconfig.php in editor and change path to Sphinx Indexer, Sphinx conf and index name (optional) 3. Use "crontab -e" to add the following lines to your crontab:
Delta index. Run cron job every 5 minutes to update delta index:*/5 * * * * /usr/bin/php /path/to/wp-content/plugins/sphinxsearch/cron/reindex.php delta
main indexing. Run cron job once a day to update main index: Run every day in 0 hours and 5 minutes5 0 * * * /usr/bin/php /path/to/wp-content/plugins/sphinxsearch/cron/reindex.php main
Configure the Sphinx Search plugin: 1. You can control the majority of options via admin area of WordPress. Go to "WP-Admin -> Options -> SphinxSearch" to do it.
Customize your WordPress templates to show the Sphinx search field: Template tags: You can use the following tags in your templates: 1. Search form in sidebar: 2. Search form on the top of search results: 3. Top 10 search results: 4. 10 latest search results: 5. To find out if the current post is comment: 6. If you want to use tags in post title - please use next function instead of the_title():




