Re: AW: [htdig] AND OR in restrict

Subject: Re: AW: [htdig] AND OR in restrict
From: Gilles Detillieux (
Date: Tue Aug 15 2000 - 09:58:45 PDT

According to Reich, Stefan:
> I don't think logical operators are supported for restrict (at least for
> HTDIG <= 3.1.5)
> You can send more than one restrict, which acts like an or
> (restrict=g21&restrict=g22)
> And wouldn't make sense, because a single document has only one url.

> Von: Eric Persson []
> I'm trying to make a restrict with or clauses. I want the search to restrict
> by
> G21 OR G22. I tried doing restrict=G21|G22 but it doesnt seem to return
> anything at all.
> I am not using the builin forms since I fetch the result with a small
> script,
> so I want to be able to send the restrict piece urlencoded.
> But how do I get the or stuff to work?

There are no logical operators supported for restrict. htsearch simply
ORs together the strings, i.e. it will restrict results to URLs that
match at least one of the given substrings. Both syntaxes above will
be equivalent. You can use




either of which will restrict results to URLs containing either G21 or G22
(or both). URL encoding is only an issue if you want to embed special
characters in the restrict patterns, such as a "+" sign (encoded as %2B)
or a space (encoded as "+" or "%20"). In the second case above, the "|"
is simply a string separator, and is not parsed as a boolean operator.

Gilles R. Detillieux              E-mail: <>
Spinal Cord Research Centre       WWW:
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------ To unsubscribe from the htdig mailing list, send a message to You will receive a message to confirm this. List archives: <> FAQ: <>

This archive was generated by hypermail 2b28 : Mon Aug 14 2000 - 23:58:55 PDT