One of our students tried to write a page for an advanced search.
What he did was to create this form:

<form method="post" action="/htdig/htsearch">
  <input type="hidden" name="config" value="www">
  <input type="hidden" name="method" value="or">

  <b>Find results</b><br>
  with <b>any</b> of the words (or):
        <input type="text" size="30" name="words" value=""><br>
  with <b>all</b> of the words (and):
        <input type="text" name="keywords" size="30" value=""><br>
  <br>
  URL <b>must not</b> contain <input type="text" name="exclude"
size="30"><br>
  URL <b>must</b> contain <input type="text" name="restrict"
size="30"><br>
  <input type="submit" value="Search...">
</form>

This works fine, except when 'words' is left empty. Then I get a sytax
error with "Expected a search word instead of ')'".
According to the documentation, 'keywords' is added to 'words' using
logical 'and'. I think it makes sense to use 'words' and 'keywords' like
this because it gives you a lot of potential for the search. I don't
know much about C++, but I think the only thing missing is a test in
addRequiredWords() in htsearch.cc whether searchWords is empty or not.
First when '(' and ')' are inserted and second during the first run of
the loop. 
But perhaps there is another way to get around this problem.

Thanks in advance


Berthold Cogel  


-- 
Dr. rer. nat. Berthold Cogel                   University of Cologne
E-Mail: [EMAIL PROTECTED]                 ZAIK-US (RRZK)
Tel.:   +49(0)221/478-7020                     Robert-Koch-Str. 10
FAX:    +49(0)221/478-5568                     D-50931 Cologne - Germany

_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to