Changeset 3160
- Timestamp:
- 2002-06-21T14:42:45+12:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/querytools.cpp
r3149 r3160 290 290 } 291 291 292 // search history tool 292 // search history tool 293 // also used for form query macros 293 294 text_t escape_quotes(const text_t &querystring) { 294 295 … … 334 335 for (int i=0; i< values.size(); i++) { 335 336 if (!values[i].empty()) { 336 text_t text = formatelem(values[i]); 337 addqueryelem(querystring, fields[i], text, combine); 338 } 339 } 340 341 } 342 343 text_t formatelem(text_t &text) { 344 345 text_t::iterator here = text.begin(); 346 text_t::iterator end = text.end(); 347 348 bool space = false; 349 int words = 0; 350 text_t newtext = ""; 351 while (here != end) { 352 if (is_unicode_letdig(*here)) { 353 newtext.push_back(*here); 354 if (space==false) words++; 355 space = true; 356 } 357 else { 358 if (space) { 359 newtext.push_back(' '); 360 space = false; 361 } 362 } 363 here++; 364 } 365 366 if (words > 1) { // have a phrase, put it in quotes 367 newtext = "\""+newtext+"\""; 368 } 369 return newtext; 370 } 337 addqueryelem(querystring, fields[i], values[i], combine); 338 } 339 } 340 341 } 342 371 343 372 344 void parse_adv_query_form(text_t &querystring, cgiargsclass &args){ … … 407 379 else if (combs[i-1]=="not")combine = "!"; 408 380 } 409 text_t term = formatelem(values[i]); 410 term = addstemcase(term, stems[i], folds[i]); 381 text_t term = addstemcase(values[i], stems[i], folds[i]); 411 382 addqueryelem(querystring, fields[i], term, combine); 412 383 } … … 477 448 478 449 } 479 if (tag=="ZZ" ) { // just add onto querystring450 if (tag=="ZZ" || tag=="") { // just add onto querystring 480 451 querystring += query; 481 452 }
Note:
See TracChangeset
for help on using the changeset viewer.