Re: [htdig] asterix

Brett Baugh (
Tue, 23 Feb 1999 12:13:30 -0600

"Ribbe, Andreas" wrote:
> How can I use signs like * and ? in the searchfield of ht://dig ?

Someone asked about this a while back. Here's the reply I gave him
(hope it's still valid :)

There are two searching algorithms you can define in the
"search_algorithm" setting in your .conf file: 'substring' and
Thus you might end up with something like:

search_algorithm: exact:1 substring:0.9 prefix:0.9 synonyms:0.25

..where the numbers are the weight to give each type of match.
Anyway, defining 'prefix' searching actually lets you use "*" in
keywords; it matches the _endings_ of words in the database. Thus
you could search for "query*" but not "*query*". 'substring' searches
take a lot longer, though, because it searches every part of each word
in the database for a match, kind of like doing a 'grep' on it. That
doesn't use wildcards though; it just always does it if it's defined
in your .conf file. Thus just putting "query" in the keywords field
of a search form actually does "*query*" instead... all the time...
and weights the results according to your 'search_algorithm' settings.

Perhaps a good enhancement for htdig would be for htsearch to use a
"substring" type search if it sees any wildcards at all in the
keywords, drop the whole "prefix" idea altogether, and perhaps not try
to do a
substring search if there aren't any wildcards in the keywords. Just
my 0.0181756 Euros worth...

-Brett Baugh
Systems Administrator, Saper Media Group
To unsubscribe from the htdig mailing list, send a message to containing the single word "unsubscribe" in
the SUBJECT of the message.

This archive was generated by hypermail 2.0b3 on Fri Feb 26 1999 - 14:34:12 PST