Ignore:
Timestamp:
1999-08-25T16:47:55+12:00 (25 years ago)
Author:
sjboddie
Message:

added advanced search option - other minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/querytools.cpp

    r403 r470  
    1212/*
    1313   $Log$
     14   Revision 1.5  1999/08/25 04:47:55  sjboddie
     15   added advanced search option - other minor changes
     16
    1417   Revision 1.4  1999/07/19 00:16:58  sjboddie
    1518   no longer display documents that don't match all phrases in query string
     
    4548  OptionValue_t option;
    4649  text_t formattedstring = args["q"];
    47  
     50  format_querystring (formattedstring, args.getintarg("b")); 
     51
    4852  option.name = "Term";
    4953  option.value = formattedstring;
     
    8791   
    8892    text_t formattedstring2 = args["q2"];
    89     format_querystring (formattedstring2);
     93    format_querystring (formattedstring2, args.getintarg("b"));
    9094
    9195    option.name = "Term";
     
    147151}
    148152
    149 void format_querystring (text_t &querystring) {
     153void format_querystring (text_t &querystring, int querymode) {
    150154  text_t formattedstring;
    151155
     
    159163
    160164  // want to remove ()|!& from querystring so boolean queries are just
    161   // "all the words" queries
     165  // "all the words" queries (unless querymode is advanced)
    162166  while (here != end) {
    163     if (*here == '(' || *here == ')' || *here == '|' ||
    164     *here == '!' || *here == '&') {
     167    if ((querymode == 0) && (*here == '(' || *here == ')' || *here == '|' ||
     168                 *here == '!' || *here == '&')) {
    165169      formattedstring.push_back(' ');
    166170    } else {
Note: See TracChangeset for help on using the changeset viewer.