Changeset 1067 for branches/corba/gsdl/src/colservr/mgsearch.cpp
- Timestamp:
- 2000-04-05T03:02:39+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/corba/gsdl/src/colservr/mgsearch.cpp
r633 r1067 28 28 /* 29 29 $Log$ 30 Revision 1.22.2.1 2000/04/04 15:02:32 cs025 31 Corba first commit 32 30 33 Revision 1.22 1999/09/24 02:41:21 rjmcnab 31 34 change to use has_unicode_letdig in text_t … … 391 394 } 392 395 393 396 /** 397 * search directs the whole execution of the search; a number of other 398 * functions in this class are called as a result, and precondition 399 * checks are also made 400 */ 394 401 bool mgsearchclass::search(const queryparamclass &queryparams, 395 402 queryresultsclass &queryresults) { 396 403 assert (cache != NULL); 397 404 405 // clear any previous results 398 406 queryresults.clear(); 399 407 … … 406 414 if (makeindexcurrent (queryparams.index, queryparams.subcollection, 407 415 queryparams.language, queryparams.collection)) { 416 // initialise the form of results 408 417 setsearchmode (queryparams); 418 419 // execute the query 409 420 submitquery (queryparams); 421 422 // retrieve the results 410 423 getresults (queryparams, queryresults); 424 411 425 return true; 412 426 } … … 453 467 } 454 468 455 469 /** 470 * submitquery constructs the query string (into UTF8 encoding) 471 * and submits it using mgq_ask to the mg search engine. Most 472 * of the processing will be done inside Greenstone 473 */ 456 474 void mgsearchclass::submitquery (const queryparamclass &queryparams) 457 475 { 458 // sort out the query string 476 // sort out the query string; copy it, remove all special characters 477 // and then convert it to a string in UTF8 format 459 478 text_t ttquerystring = queryparams.querystring; 460 479 filterquery (ttquerystring); … … 464 483 mgq_ask(querystring); 465 484 485 // destroy the temporary character array 466 486 delete querystring; 467 487 } 468 488 469 489 /** 490 * getrults is called to retrieve the required data on the docs 491 * which responded to the query submitted in submitquery above. 492 * 493 * It calls the local mgquery (mgq) interface to MG several times, 494 * to obtain the document numbers, term frequencies, term variants 495 * etc. All processing of the query will be done by Greenstone 496 * thereafter 497 */ 470 498 void mgsearchclass::getresults (const queryparamclass &queryparams, 471 499 queryresultsclass &queryresults) { 472 500 // get the configuration for the maximum number of documents to 501 // retrieve 473 502 int howmany = queryparams.maxdocs; 474 503 if (howmany == -1) howmany = MAXNUMDOCS; … … 504 533 } 505 534 535 /** 536 * Tidies the given querystring, removing special characters 537 */ 506 538 void mgsearchclass::filterquery (text_t &ttquerystring) { 507 539 text_t::iterator ithere = ttquerystring.begin ();
Note:
See TracChangeset
for help on using the changeset viewer.