Re: htdig: multiple restricts -is it possible


Jesse op den Brouw (jesse@crytonII.st.hhs.nl)
Tue, 17 Feb 1998 13:41:38 +0100


Joachim Zobel wrote:
>
> Hi.
>
> Is there a way I can have a list of patterns for restrict, so that I get
> all results that match one of these patterns? I'm setting up a search
> engine for some documentation and I would love to have check boxes for
> certain areas to search.

>From previous questions about this subject:

This question has been posted before. I think I have a (or the)
solution.
When looking through the 3.08b2 source files, I found a line in
htlib directory, file StringMatch.cc:

(snip)

    //
    // Go though each of the patterns and build entries in the table.
    //
    int state = 0;
    int totalStates = 0;
    unsigned char previous = 0;
    int previousState = 0;
    int previousValue = 0;
    int index = 1;
    unsigned char chr;

    while ((unsigned char)*pattern)
    {
        chr = trans[(unsigned char)*pattern];
        if (chr == '|')
        {
            //
            // Next pattern
            //

(snip)

It says "Go though EACH of the ....". So, it must be possible to
enter more patterns.

The line

         if (chr == '|')

gives the answer, I think: use a | (pipe sign). So this is what I
put in my search.html

         Beperk tot: <select name=restrict>
         <option value="">(geen beperking)
         <option value=www.hhs.nl>hogeschool web-server
2) <option value=www.st.hhs.nl selected>sector techniek
1) <option value=www.si.hhs.nl>sector I&I
         <option value=www.sem.hhs.nl>sector E&M
         <option value=www.sost.hhs.nl>sector OST
         <option value=www.hhs.nl/sggm>sector GG&M
3) <option value="www.si.hhs.nl|www.st.hhs.nl">technische sectoren
         </select>

Note 3): it is a concatanation(?) of 1) and 2) and note the '|' sign.
I tested it once, and it worked for me. Gonna test is some more, but
maybe this is the solution.

 
--jesse
---------------------------------------------------------------------
J. op den Brouw Johanna Westerdijkplein 75
Haagse Hogeschool 2521 EN DEN HAAG
Faculty of Engineering Netherlands
Electrical Engineering +31 70 4458936
-------------------- J.E.J.opdenBrouw@st.hhs.nl ---------------------

Linux - because reboots are for hardware changes
----------------------------------------------------------------------
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:25:41 PST