ChangeLog

15-06-2019

  • Made the plugin compatible with the latest DokuWiki release.
  • Moved "Matching pagenames" to the top of the search and made the search results full width.
  • Branched out inline JS code to "js/search.js" and CSS code to "css/style.css".
  • Used CSS to override the "prev", "next" and "Search help" text-only links with icons.
  • Added the option to hide the Sphinx Search plugin version from the Dokuwiki configuration.
  • Bumped the text extracts to 500 words and 10 surrounding words and made these values configurable.
  • Removed deprecated options from "sphinx.conf" as per the Sphinx Search documentation.

About

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.

Download

Code

The code can be checked out via Subversion from:

Requirements

    • Debian-based distributions can most likely install the package sphinxsearch via the package manager.
  • PHP >= 7.x with SQLite extension (it is enabled by default as of PHP 5)

Demonstration

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

Original

  • Unpack the plugin files into lib/plugins directory of your DokuWiki installation.
  • 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
  • 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).

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

  • Unpack the plugin files into lib/plugins directory of your DokuWiki installation.
  • 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).
  • 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.
  • Issue the commands in sequence:
systemctl daemon-reload
systemctl enable sphinx-searchd-grimore
systemctl start sphinx-searchd-grimore

to enable the Sphinx 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


dokuwiki/sphinxsearch.txt ยท Last modified: 2022/04/19 08:28 by 127.0.0.1

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.