dokuwiki-sphinxsearch-plugin – Blame information for rev 1

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