Changeset 1860 for trunk/gsdl/src/colservr/mgsearch.cpp
- Timestamp:
- 2001-01-26T07:26:45+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/mgsearch.cpp
r1497 r1860 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$ 25 * 24 26 *********************************************************************/ 27 28 /* 29 $Log$ 30 Revision 1.28 2001/01/25 18:26:44 cs025 31 Included CORBA branch for first time 32 33 Revision 1.22.2.1 2000/04/04 15:02:32 cs025 34 Corba first commit 35 36 Revision 1.22 1999/09/24 02:41:21 rjmcnab 37 change to use has_unicode_letdig in text_t 38 39 Revision 1.21 1999/09/21 21:41:41 sjboddie 40 fixed an error in what I committed last 41 42 Revision 1.20 1999/09/21 11:59:26 sjboddie 43 added Maxdocs queryfilter option (which may be -1 for 'all) 44 45 Revision 1.19 1999/09/07 22:52:52 rjmcnab 46 Seems to be an error in mg for retrieving documents using a paragraph 47 based index for some cases. Just added a work around (loads the default 48 index every time). 49 50 Revision 1.18 1999/09/07 04:57:22 sjboddie 51 added gpl notice 52 53 Revision 1.17 1999/08/31 22:42:41 rjmcnab 54 A couple of minor things. 55 56 Revision 1.16 1999/08/25 04:51:06 sjboddie 57 small change to allow for searching using boolean operators 58 59 Revision 1.15 1999/07/16 08:35:03 rjmcnab 60 Fixed a weird bug to do with a faulty case statement. 61 62 Revision 1.14 1999/07/16 03:42:22 sjboddie 63 changed isApprox 64 65 Revision 1.13 1999/07/16 00:12:46 sjboddie 66 removed all the old post-processing stuff 67 68 Revision 1.12 1999/07/07 06:17:47 rjmcnab 69 broke search_index into index+subcollection+language 70 within mgsearch 71 72 Revision 1.11 1999/07/05 21:06:43 rjmcnab 73 Disabled quoted strings. 74 75 Revision 1.10 1999/07/01 09:29:19 rjmcnab 76 Changes for better reporting of number documents which match a query. Changes 77 should still work as before with older versions of mg. 78 79 Revision 1.9 1999/07/01 03:54:48 rjmcnab 80 Added code to plug in the equivalent terms of each of the query terms. 81 Also added a function to get a raw utf8 encoded mg document (for speeding 82 up a phrase matching function) 83 84 Revision 1.8 1999/06/30 04:04:12 rjmcnab 85 made stemming functions available from mgsearch and made the stems 86 for the query terms available in queryinfo 87 88 Revision 1.7 1999/06/27 22:07:27 sjboddie 89 got rid of all the old functions for dealing with dir indexes 90 91 Revision 1.6 1999/06/09 00:41:32 sjboddie 92 phrase searching now uses case-folding if it's turned on 93 94 Revision 1.5 1999/02/21 22:31:35 rjmcnab 95 96 Removed locateinfo. 97 98 Revision 1.4 1999/02/03 01:13:27 sjboddie 99 100 Got interface to handle subcollections and language subcollections - 101 committed changes made to some of the collections 102 103 Revision 1.3 1999/01/19 01:38:17 rjmcnab 104 105 Made the source more portable. 106 107 Revision 1.2 1999/01/12 01:51:02 rjmcnab 108 109 Standard header. 110 111 Revision 1.1 1999/01/08 09:02:16 rjmcnab 112 113 Moved from src/library. 114 115 */ 25 116 26 117 #include "gsdlconf.h" … … 299 390 } 300 391 301 392 /** 393 * search directs the whole execution of the search; a number of other 394 * functions in this class are called as a result, and precondition 395 * checks are also made 396 */ 302 397 bool mgsearchclass::search(const queryparamclass &queryparams, 303 398 queryresultsclass &queryresults) { 304 399 // assert (cache != NULL); 305 400 401 // clear any previous results 306 402 queryresults.clear(); 307 403 // first check the cache … … 314 410 if (makeindexcurrent (queryparams.index, queryparams.subcollection, 315 411 queryparams.language, queryparams.collection)) { 412 // initialise the form of results 316 413 setsearchmode (queryparams); 414 415 // execute the query 317 416 submitquery (queryparams); 417 418 // retrieve the results 318 419 getresults (queryparams, queryresults); 420 319 421 return true; 320 422 } … … 361 463 } 362 464 363 465 /** 466 * submitquery constructs the query string (into UTF8 encoding) 467 * and submits it using mgq_ask to the mg search engine. Most 468 * of the processing will be done inside Greenstone 469 */ 364 470 void mgsearchclass::submitquery (const queryparamclass &queryparams) 365 471 { 366 // sort out the query string 472 // sort out the query string; copy it, remove all special characters 473 // and then convert it to a string in UTF8 format 367 474 text_t ttquerystring = queryparams.querystring; 368 475 filterquery (ttquerystring); … … 372 479 mgq_ask(querystring); 373 480 481 // destroy the temporary character array 374 482 delete querystring; 375 483 } 376 484 377 485 /** 486 * getrults is called to retrieve the required data on the docs 487 * which responded to the query submitted in submitquery above. 488 * 489 * It calls the local mgquery (mgq) interface to MG several times, 490 * to obtain the document numbers, term frequencies, term variants 491 * etc. All processing of the query will be done by Greenstone 492 * thereafter 493 */ 378 494 void mgsearchclass::getresults (const queryparamclass &queryparams, 379 495 queryresultsclass &queryresults) { 380 496 // get the configuration for the maximum number of documents to 497 // retrieve 381 498 int howmany = queryparams.maxdocs; 382 499 if (howmany == -1) howmany = MAXNUMDOCS; … … 412 529 } 413 530 531 /** 532 * Tidies the given querystring, removing special characters 533 */ 414 534 void mgsearchclass::filterquery (text_t &ttquerystring) { 415 535 text_t::iterator ithere = ttquerystring.begin ();
Note:
See TracChangeset
for help on using the changeset viewer.