DokuWiki Sphinx search tutorial

Features | Screenshots | Installation | Configuration options | FAQ | Support


DokuWiki Sphinx search plugin replaces DokuWiki’s built-in search functionality with the Sphinx-powered search which gives high-performance and more relevant search results.


To use this plugin you need to have Sphinx Search installed and PHP5 with SQLite extension (SQLite is enabled by default as of PHP 5).

Download the latest version of the plugin from BitBucket:

Follow these steps:

  1. Unpack plugin files into lib/plugins directory of your DokuWiki installation.
  2. Run Sphinx Search indexer to index your DokuWiki data for the first time. Note: you have to run it from lib/plugins/sphinxsearch directory. e.g.:
    $cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch
    $indexer -c sphinx.conf dk_main
  3. After indexer completes it’s job, run searchd, e.g.:
    $searchd -c sphinx.conf
  4. To have your search results up-to-date, setup cronjob to periodically re-index your DokuWiki data, e.g.:
    1 10 * * * root {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/indexer.php

Configuration options

You can fine-tune the search behavior by editing the configuration file in conf/default.php.

  • Define custom Sphinx host, port and index name.
  • Control the way results look with maxresults, snippetsize and aroundwords which defines the excerpt sizes.
  • Control weights by setting body_priority, title_priority, pagename_priority or namespace_priority for namespace matching


Q: I get “sh: php: not found”
A: It seems your system on this server doesn’t know where is php located.
You should specify this in sphinx.conf file (line 7), there is such line:

xmlpipe_command = php xmlall.php

you can find out php path with running such command:

$ which php

usually it’s in /usr/bin/php, so your changed line in sphinx.conf would look like:

xmlpipe_command = /usr/bin/php xmlall.php


Q:  I am not sure why i should run everything as root? I execute the indexer and searchd as apache and there seems to be no problems.
A:  root user is just an example,  you may use any other user with proper permission to run indxer/searchd applicaitons.


This plugin is developed by Ivinco. If you need commercial support, or if you’d like DokuWiki Sphinx Search Plugin customized for your needs, we can help. Visit plugin website for the latest news.
See release notes, report bugs and feature wishes on BitBucket: