Re: [htdig] Dummies Guide to Restricting searchs


Subject: Re: [htdig] Dummies Guide to Restricting searchs
From: Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Date: Thu Nov 16 2000 - 09:45:18 PST


According to Terry Collins:
> Geoff Hutchison wrote:
> > At 12:14 PM +1100 11/16/00, Terry Collins wrote:
> > >I understand from my reading that I can restrict the search to returning
> > >only results from one list. i.e. http://www.woa.com.au/lists/list-name
> > >by using exclude and restrict parameters when htsearc is called.
> > >
> > >My problem is that I don't understand HOW to go about this?
> > >Can anyone point me to some further info/how-to/etc?
> >
> > See <http://www.htdig.org/hts_form.html>
> >
> > (esp. the "restrict" and "exclude" portions)

See also the FAQ: http://www.htdig.org/FAQ.html#q4.20

> This is what I had read before posting, but the how-to-do-it eluded me
> (html is rather limited). Then in the usual fashion of an illumination
> coming as soon as you post to a list, I tried making the link read
> http://www.woa.com.au/cgi-bin/htsearch?config=&restrict=lists/slug
> which seems to work and it carries the restriction forward for
> successive searches. Seems because at the moment, it is still doing
> indexing of the other areas.
>
> Is this autocarry forward of the restriction reliable?

Yes, as long as you don't break it by removing the hidden input field
for "restrict" in the follow up search forms in common/*.html. Ditto
for "exclude", "config" and all the others.

> However, I'd like to allow them to enter a search value for the first
> search rather than return an error message first up.
>
> I've also looked at somewhere else that had a form (something I've never
> used before) and cut-and-pasted into my page.
>
> <form method="get" action="/cgi-bin/htsearch">
> <p><input type="text" size="30" name="words" value="">
> <input type="submit" value="Search"></p>
> </form>
>
> I changed action to read
> action="/cgi-bin/htsearch?config=&restrict=/lists/slug" but it instantly
> drops the restriction off the form.
>
> Is this the way to do it?
> Can anyone tell me why the restriction is dropped?

This doesn't work because the input parameters defined in the search form
override any query string you provide in the action URL.

As you discovered, the hidden input fields are the way to provide pre-set
input values to a CGI program. The sample search.html form that comes with
the package includes examples of such hidden input fields.

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
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 htdig-unsubscribe@htdig.org You will receive a message to confirm this. List archives: <http://www.htdig.org/mail/menu.html> FAQ: <http://www.htdig.org/FAQ.html>



This archive was generated by hypermail 2b28 : Thu Nov 16 2000 - 09:54:14 PST