1====== Requirements ====== 2 31. Sphinx Search v2.x: http://www.sphinxsearch.com/downloads.html 4 5Debian-based distributions can most likely install the package ''sphinxsearch'' 6via the package manager. 7 82. PHP >= 7.x with SQLite extension (it is enabled by default as of PHP 5) 9 10====== Demonstration ====== 11 12 * http://grimore.org/start?do=search&id=start&q=dokuwiki 13 14====== Installation ====== 15 16The original installation instructions are preserved in this section to serve 17as a milestone. You can skip ahead to the recent installation instructions if 18you are running a fairly recent Linux-based machine. 19 20===== Original ===== 21 221. Unpack the plugin files into lib/plugins directory of your DokuWiki installation. 23 242. Run Sphinx Search indexer to index your DokuWiki data for the first time: 25 $cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/ 26 $indexer -c sphinx.conf dk_main 27 283. After indexer completes its job, run searchd, e.g.: 29 $cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/ 30 $searchd -c sphinx.conf 31By default plugin is using 9312 as the searchd port, so make sure this 32port is free (if you have sphinx on other port, see #5). 33 344. To have your search results up-to-date, setup a cron job to 35periodically re-index your DokuWiki data, e.g.: 36 1 10 * * * root {Your_DokuWiki_Path}/lib/plugin/sphinxsearch/indexer.php 37 385. You can fine-tune the search behavior by editing the configuration files 39conf/default.php and sphinx.conf. 40 41===== Recent ===== 42 43The recent installation requires a Linux operating system that uses systemd for 44script management and has a crontab setup that uses ''/etc/cron.*'' directories 45as time divisions. The setup is targeted mainly at the Debian family of Linux 46distributions (ie: should be applicable flawlessly to Ubuntu). 47 481. Unpack the plugin files into lib/plugins directory of your DokuWiki installation. 49 502. Copy the file from ''contrib/cron.daily/sphinx-rotate-grimore'' into the system folder 51at ''/etc/cron.daily/'' - the file must be edited to adjust the variable at the top of 52the script $PATH_TO_PLUGIN_DIRECTORY to point to the directory of the plugin. 53 54The file itself ''sphinx-rotate-grimore'' placed in cron.daily will ensure that your 55search is updated on a daily basis. Other candidates include other cron directories 56with self-explanatory names such as ''/etc/cron.hourly'', ''/etc/cron.monthly'', etc. 57 58If so desired, you can rename the file ''sphinx-rotate-grimore'' to any name you like. 59 60Finally, ensure that the file is made executable (for instance, by issuing the command 61''chmod +x /etc/cron.daily/sphinx-rotate-grimore''). 62 633.) Copy the file from ''contrib/etc/systemd/system/sphinx-searchd-grimore.service'' 64into ''/etc/systemd/system'' and edit it such that the path 65''/var/www/grimore.org/lib/plugins/sphinxsearch'' points to the ''sphinxsearch'' 66directory under your ''lib/plugins'' folder of the DokuWiki installation. 67 684.) Issue the commands in sequence: 69<code bash> 70systemctl daemon-reload 71systemctl enable sphinx-searchd-grimore 72systemctl start sphinx-searchd-grimore 73</code> 74to enable the Sphix ''searchd'' service and start it. 75 76====== Notes on Modding ====== 77 78Part of the work being carried out is to sever CSS & HTML inlinecode from the PHP codebase 79into separate files. You should be able to edit ''css/style.css'' to change the aspect of 80the search results. 81 82====== Issues and Workarounds ====== 83 84In case the wiki to be installed to contains very long pages then it may be necessary to 85bump the memory allowance of PHP - this can be done by editing the ''php.ini'' file and 86setting the variable ''memory_limit'' to a higher value. A manifestation of this problem 87would be noticed by searching for for a term that is contained within a very long page. 88The search will take a significant amount of time and would yield a blank page. 89 90====== Support ====== 91 92This plugin is a fork of Ivinco Ltd.'s sphinxsearch by Wizardry and Steamworks 93and can be found on the Wizardry and Steamworks website 94@ http://grimore.org/dokuwiki/sphinxsearch