xref: /plugin/sphinxsearch-was/INSTALL (revision 118:1e013a6df2d1)
129Syaroslav@ivinco.com====== Requirements ======
2*118Syaroslav
329Syaroslav@ivinco.com1. Sphinx Search v2.x: http://www.sphinxsearch.com/downloads.html
429Syaroslav@ivinco.com
529Syaroslav@ivinco.comDebian-based distributions can most likely install the package ''sphinxsearch''
624Syaroslav@ivinco.comvia the package manager.
716Syaroslav@ivinco.com
829Syaroslav@ivinco.com2. PHP >= 7.x with SQLite extension (it is enabled by default as of PHP 5)
929Syaroslav@ivinco.com
1029Syaroslav@ivinco.com====== Demonstration ======
1129Syaroslav@ivinco.com
1284Syaroslav@ivinco.com  * http://grimore.org/start?do=search&id=start&q=dokuwiki
1388Syaroslav@ivinco.com
1490Syaroslav@ivinco.com====== Installation ======
1529Syaroslav@ivinco.com
1630Syaroslav@ivinco.comThe original installation instructions are preserved in this section to serve
1788Syaroslav@ivinco.comas a milestone. You can skip ahead to the recent installation instructions if
1888Syaroslav@ivinco.comyou are running a fairly recent Linux-based machine.
1982Syaroslav@ivinco.com
2082Syaroslav@ivinco.com===== Original =====
2129Syaroslav@ivinco.com
2282Syaroslav@ivinco.com1. Unpack the plugin files into lib/plugins directory of your DokuWiki installation.
2382Syaroslav@ivinco.com
2424Syaroslav@ivinco.com2. Run Sphinx Search indexer to index your DokuWiki data for the first time:
2529Syaroslav@ivinco.com        $cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/
2682Syaroslav@ivinco.com	$indexer -c sphinx.conf dk_main
2782Syaroslav@ivinco.com
2823Syaroslav@ivinco.com3. After indexer completes its job, run searchd, e.g.:
2916Syaroslav@ivinco.com        $cd {Your_DokuWiki_Path}/lib/plugins/sphinxsearch/
3082Syaroslav@ivinco.com	$searchd -c sphinx.conf
3129Syaroslav@ivinco.comBy default plugin is using 9312 as the searchd port, so make sure this
3282Syaroslav@ivinco.comport is free (if you have sphinx on other port, see #5).
3382Syaroslav@ivinco.com
3482Syaroslav@ivinco.com4. To have your search results up-to-date, setup a cron job to
3582Syaroslav@ivinco.comperiodically 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