Ignore:
Timestamp:
2009-09-02T15:49:49+12:00 (15 years ago)
Author:
kjdon
Message:

added get_plain_query_terms method to querytools (only partially implemented so far), and use it in queryaction to clean up the q arg and save as _queryterms_ macro - used for PDF search parameter

File:
1 edited

Legend:

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

    r18459 r20481  
    332332}
    333333
    334 
    335    
     334// turn query string into terms separated by spaces.
     335// still working on this...
     336text_t get_plain_query_terms(const text_t &querystring) {
     337
     338  text_t::const_iterator here = querystring.begin();
     339  text_t::const_iterator end = querystring.end();
     340  text_t terms = "";
     341  bool space = false;
     342  while (here != end) {
     343    if (*here ==  '#' || *here == '/') {
     344      // skip over #is /10 etc
     345      ++here;
     346      while (here != end && *here != ' ') {
     347    ++here;
     348      }
     349      if (here == end) break;
     350    }
     351    if (*here == '[') {
     352      // get the text out and ignore the :TI after
     353    }
     354    if (is_unicode_letdig(*here)) {
     355      terms.push_back(*here);
     356      space = false;
     357    } else {
     358      if (!space) {
     359    terms.push_back(' ');
     360    space = true;
     361      }
     362    }
     363    ++here;
     364  }
     365  return terms;
     366   
     367}
    336368
    337369// search history tool
Note: See TracChangeset for help on using the changeset viewer.