dokuwiki-sphinxsearch-plugin – Rev 1

Subversion Repositories:
Rev:
====== Requirements ======
 
1. Sphinx Search v2.x: http://www.sphinxsearch.com/downloads.html

Debian-based distributions can most likely install the package ''sphinxsearch''
via the package manager.

2. PHP >= 7.x with SQLite extension (it is enabled by default as of PHP 5)

====== Demonstration ======

  * http://grimore.org/start?do=search&id=start&q=dokuwiki

====== Installation ======

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-based machine.

===== Original =====

1. Unpack the plugin files into lib/plugins directory of your DokuWiki installation.

2. Run Sphinx Search indexer to index your DokuWiki data for the first time:
        $cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/
        $indexer -c sphinx.conf dk_main

3. After indexer completes its job, run 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).

4. To have your search results up-to-date, setup a cron job to
periodically re-index your DokuWiki data, e.g.:
    1 10 * * * root {Your_DokuWiki_Path}/lib/plugin/sphinxsearch/indexer.php

5. You can fine-tune the search behavior by editing the configuration files 
conf/default.php and sphinx.conf.

===== Recent =====

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). 

1. Unpack the plugin files into lib/plugins directory of your DokuWiki installation.

2. Copy the file from ''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'').

3.) Copy the file from ''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.

4.) Issue the commands in sequence:
<code bash>
systemctl daemon-reload
systemctl enable sphinx-searchd-grimore
systemctl start sphinx-searchd-grimore
</code>
to enable the Sphix ''searchd'' service and start it.

====== Notes on Modding ======

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.

====== Issues and Workarounds ======

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.

====== Support ======

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

Generated by GNU Enscript 1.6.5.90.