Extension:HtdigSearch

What can this extension do?
This extension allow to integrate ht:/Dig search in your wiki. This special page acts as a mediawiki proxy on configured htsearch CGI url.

Download instructions
You can download HtdigSearch extension from there.

Installation
To install this extension, put HtdigSearch in your extensions directory, then add the following to LocalSettings.php:

Ajust values on HtdigSearch/HtdigSettings.php file :

You can verify installation opening wiki page Special:HtdigSearch.

Configuration parameters
See HtdigSearch/HtdigSettings.php

fopen for url should be enabled in your php.ini.

Encoding issue
ht:/Dig only supports iso-8859-1 charset, if your wiki is maid with another one you will have to add accept-charset="iso-8859-1" attribute to your search form tag :


 * See also : ht:/Dig utf8 workaround (internal handler) (based on iconv and some unix stuff)

Incremental update (HtdigUpdate)
With HtdigUpdate code (added to this extension — 2008-11-19), you can make your ht:/Dig update be updated as soon as you make a new revision of an article. As LocalSettings.php is concerned you just have to uncomment HtdigUpdate line from provided sample LocalSettings.part.

You also have to check parameters htdigConfdir, htdigConfSuffix and htdigProgPath</tt> in extension configuration file HtdigSettings.php</tt>.

Main job about that is to ensure apache user (user that run apache server), has proper rights to execute htdig program, and to write ht:/Dig database. You can check it, before having activated HtdigUpdate, under unix with following commands (with «apache» as apache user, «/etc/htdig/my.wiki.conf» your ht:/Dig site configuration file, and «http://my.wiki.com/index.php/MyArticle» an article changed after last ht:Dig database update) :


 * 1) su -s /bin/bash apache
 * 2) echo 'http://my.wiki.com/index.php/MyArticle' | htdig -c '/etc/htdig/my.wiki.conf' -m -

If you get following error «htdig: Unable to open/create document database», you need you check right granted to apache user on ht:/Dig database files are sufficient (ht:/Dig database directory path should be set in htdig.conf</tt> or in your ht:/Dig site configuration file). In this case you will probably want to run commands such as following, in order to fix permissions (with «/var/htdig/my.wiki.com» path to your ht:/Dig database directory):


 * 1) chgrp apache /var/htdig/my.wiki.com/db.*
 * 2) chmod g+w /var/htdig/my.wiki.com/db.*

You could also have permission trouble about htdig program himself, if not executable by apache user, or about program(s) you set as handler (external_handler) in your ht:/Dig configuration file. If you see such error («xxx: Permission denied») running tests commands (see at beginning of this section), you will need to chmod it to allow execute by apache user (chmod +x</tt>).

Daily update/database optimisation
Even if use incremental update provided by HtdigUpdate code, it's strongly recommanded to recheck periodically your whole ht:/Dig database.


 * If you don't use incremental update such periodic task you update database.
 * If you use incremental update periodic recheck will clean obselete document from index and optimize database.

This can be performed using a cron script, or things like that. If you traditionnal /etc/cron.daily</tt> place, you can put under it a script like following :


 * 1) ! /bin/sh

HTDIGCMD="/path/to/your/htdig"

HTDIG_OPTS="-v -s -c /path/to/your/htdig/site.conf"

"$HTDIGCMD" $HTDIG_OPTS