15-06-2019
DokuWiki Sphinx Search plugin replaces DokuWiki's built-in search functionality with the Sphinx Search Engine powered search which gives high-performance and more relevant search results. The was
derivation is a fork of the original plugin with the goal of bringing the code up to date, adding more configurable options, some broad refactorings of the code as well as some (subjectively) aesthetic changes.
The code can be checked out via Subversion from:
sphinxsearch
via the package manager.The original installation instructions are preserved in this section to serve as a milestone. You can skip ahead to the recent installation instructions if you are running a fairly recent Linux/Debian-based machine.
lib/plugins
directory of your DokuWiki installation.indexer
to index your DokuWiki data for the first time:cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/ indexer -c sphinx.conf dk_main
searchd
, e.g.:cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/ searchd -c sphinx.conf
By default plugin is using 9312 as the searchd port, so make sure this port is free (if you have sphinx on other port, see #5).
1 10 * * * root {Your_DokuWiki_Path}/lib/plugin/sphinxsearch/indexer.php
conf/default.php
and sphinx.conf.
The recent installation requires a Linux operating system that uses systemd for script management and has a crontab setup that uses /etc/cron.*
directories as time divisions. The setup is targeted mainly at the Debian family of Linux distributions (ie: should be applicable flawlessly to Ubuntu).
contrib/cron.daily/sphinx-rotate-grimore
into the system folder at /etc/cron.daily/
- the file must be edited to adjust the variable at the top of the script $PATH_TO_PLUGIN_DIRECTORY
to point to the directory of the plugin. The file itself sphinx-rotate-grimore
placed in cron.daily will ensure that your search is updated on a daily basis. Other candidates include other cron directories with self explanatory names such as /etc/cron.hourly
, /etc/cron.monthly
, etc. If so desired, you can rename the file sphinx-rotate-grimore
to any name you like. Finally, ensure that the file is made executable (for instance, by issuing the command chmod +x /etc/cron.daily/sphinx-rotate-grimore
).contrib/etc/systemd/system/sphinx-searchd-grimore.service
into /etc/systemd/system
and edit it such that the path /var/www/grimore.org/lib/plugins/sphinxsearch
points to the sphinxsearch
directory under your lib/plugins
folder of the DokuWiki installation.systemctl daemon-reload
systemctl enable sphinx-searchd-grimore
systemctl start sphinx-searchd-grimore
to enable the Sphinx searchd
service and start it.
Part of the work being carried out is to sever CSS & HTML inlinecode from the PHP codebase into separate files. You should be able to edit css/style.css
to change the aspect of the search results.
In case the wiki to be installed to contains very long pages then it may be necessary to bump the memory allowance of PHP - this can be done by editing the php.ini
file and setting the variable memory_limit
to a higher value. A manifestation of this problem would be noticed by searching for for a term that is contained within a very long page. The search will take a significant amount of time and would yield a blank page.
This plugin is a fork of Ivinco Ltd.'s sphinxsearch by Wizardry and Steamworks and can be found on the Wizardry and Steamworks website @ http://grimore.org/dokuwiki/sphinxsearch