- Timestamp:
- 2013-03-12T14:37:44+13:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/colservr/mgqueryfilter.cpp
r16445 r27064 285 285 286 286 num_phrases = 0; 287 288 FilterOption_t filtopt; 289 // -- onePerQuery PhraseMatch enumerated 290 filtopt.name = "PhraseMatch"; 291 filtopt.type = FilterOption_t::enumeratedt; 292 filtopt.repeatable = FilterOption_t::onePerQuery; 293 filtopt.defaultValue = "some_phrases"; 294 filtopt.validValues.push_back ("all_phrases"); 295 filtopt.validValues.push_back ("some_phrases"); 296 filtopt.validValues.push_back ("all_docs"); 297 filterOptions["PhraseMatch"] = filtopt; 298 287 299 } 288 300 … … 331 343 endresults, phrasematch, logout); 332 344 // do any mg specific diddling with query parameters that may be required 333 mg_parse_query_params (request, queryfilterparams, startresults,334 endresults, phrasematch, logout);345 // mg_parse_query_params (request, queryfilterparams, startresults, 346 // endresults, phrasematch, logout); 335 347 336 348 … … 448 460 } 449 461 450 void mgqueryfilterclass:: mg_parse_query_params (const FilterRequest_t &/*request*/,462 void mgqueryfilterclass::parse_query_params (const FilterRequest_t &request, 451 463 vector<queryparamclass> &query_params, 452 int &/*startresults*/, int &/*endresults*/, 453 text_t &/*phrasematch*/, ostream &/*logout*/) { 454 455 // outconvertclass text_t2ascii; 464 int &startresults, int &endresults, 465 text_t &phrasematch, ostream &logout) { 466 467 queryfilterclass::parse_query_params (request, query_params, 468 startresults, endresults, logout); 469 470 phrasematch = filterOptions["PhraseMatch"].defaultValue; 471 472 // is there a better way to do this than iterate through all the options again?? 473 OptionValue_tarray::const_iterator options_here = request.filterOptions.begin(); 474 OptionValue_tarray::const_iterator options_end = request.filterOptions.end(); 475 while (options_here != options_end) { 476 if ((*options_here).name == "PhraseMatch") { 477 phrasematch = (*options_here).value; 478 break; 479 } 480 ++options_here; 481 } 456 482 457 483 vector<queryparamclass>::iterator query_here = query_params.begin();
Note:
See TracChangeset
for help on using the changeset viewer.