htdig: Re: 'exclude' and 'restrict'


William Rhee (willrhee@umich.edu)
Wed, 25 Nov 1998 09:55:39 -0500 (EST)


Hi there,

I made a little mistake when entering the hypothetical example below-- as
Geoff Hutchinson pointed out 'radio' is not a multiple input type. But
basically if you substitute 'checkbox' for 'radio' you'll get the behavior
I described earlier.

After a little poking around in htsearch.cc, some Socratic advice from
Geoff, and some more poking around, I made a 'caveman' patch which fixes
the behavior. If anyone with some real experience with C++ wants to make
it prettier please do.

Basically what is going on is if you send multiple 'restrict' or 'exclude'
instructions from the form, their values are not being joined together
with "|" to form a valid pattern which htsearch can make use of.

take care,
--Will

Patch for htsearch.cc:

133,141d132
< char *sep;
< while (sep = strchr(input["restrict"], '\001'))
< {
< if (sep == NULL)
< {
< break;
< }
< *sep = '|';
< }
146,154d136
< char *sep;
< while (sep = strchr(input["exclude"], '\001'))
< {
< if (sep == NULL)
< {
< break;
< }
< *sep = '|';
< }

On Mon, 23 Nov 1998, William Rhee wrote:

>
> Hi everyone,
>
> I'm trying to give the end user more control over restricting URLs which
> come back in a search. In short, I'd like to present a bunch of check
> boxes which the user can click on or off to select different criteria to
> affect the search results, for example something like this:
>
> ---snip---
> Limit the search to any of the following collections (click one or many):
> <p>
> Technotes
> <input type=radio name=restrict value=http://someplace.org/technotes/>
> <br>
> News
> <input type=radio name=restrict value=http://someplace.org/news/>
> <br>
> Events
> <input type=radio name=restrict value=http://someplace.org/calendar/>
> ---snip---
>
> When htsearch receives the multiple 'restrict' values from the form it
> would be nice if it could take all the values and join them with a pipe
> character ('|') to create the pattern to check against.
>
> The way it is now, if you set multiple values for 'exclude', all but the
> final name/value pair is ignored and the final value alone is what gets
> used for the pattern. By contrast, if you submit multiple values for
> 'restrict', I would assume the same, but I'm not sure what's going on
> because any search I do brings back no matches at all!
>
> The way that htsearch seems to work now, it doesn't consider multiple
> values when trying to build exclude/restrict patterns. It would be a nice
> feature for a new release :-)
>
> What I'm wondering is if anyone out there has already hacked this, or has
> used another approach?
>
> thanks,
> --Will
>
>
>

----------------------------------------------------------------------
To unsubscribe from the htdig mailing list, send a message to
htdig-request@sdsu.edu containing the single word "unsubscribe" in
the body of the message.



This archive was generated by hypermail 2.0b3 on Sat Jan 02 1999 - 16:28:52 PST