Re: htdig: RESTRICT Question (SOLUTION [I think])


Jesse op den Brouw (jesse@crytonII.st.hhs.nl)
Fri, 14 Nov 1997 16:25:53 +0100


Jason Oesterly wrote:
>
> Hello-
>
> I would like to set the RESTRICT form variable in a way that limits results
> to URL's containing either of two strings. For instance, I'd like to show
> results from only two sites such as 'www.site1.com' and 'www.site2.com'
> (but not other sites in the database). Is this possible?

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
Sector Techniek Netherlands
Afdeling Elektrotechniek +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:12 PST