source: trunk/gsdl/src/colservr/mgsearch.h@ 319

Last change on this file since 319 was 319, checked in by rjmcnab, 25 years ago

made stemming functions available from mgsearch and made the stems
for the query terms available in queryinfo

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/**********************************************************************
2 *
3 * mgsearch.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: mgsearch.h 319 1999-06-30 04:04:14Z rjmcnab $
9 *
10 *********************************************************************/
11
12
13#ifndef MGSEARCH_H
14#define MGSEARCH_H
15
16
17#include "text_t.h"
18#include "querycache.h"
19
20#define RESULTCACHESIZE 10
21#define MAXNUMDOCS 500
22#define MAXNUMTERMS 100
23
24class mgsearchclass {
25public:
26 mgsearchclass ();
27 virtual ~mgsearchclass ();
28
29 // the index directory must be set before any searching
30 // is done
31 void setcollectdir (const text_t &thecollectdir);
32
33 // you only need to use this function before doing any stemming
34 // casefolding and stemming will be set if values for them are
35 // provided (0 or 1).
36 // makeindexcurrent returns true if it was able to load the database
37 bool makeindexcurrent (const text_t &index, const text_t &collection,
38 int casefolding = -1, int stemming = -1);
39
40 // stem word uses the values set in the last call to makeindexcurrent
41 // to stem the word. It is assumed that word is in unicode
42 text_t stemword (const text_t &word);
43
44 // the search results are returned in queryresults
45 // search returns 'true' if it was able to do a search
46 bool search(const queryparamclass &queryparams,
47 queryresultsclass &queryresults);
48
49 // the document text for 'docnum' is placed in 'output'
50 // docTargetDocument returns 'true' if it was able to
51 // try to get a document
52 // collection is needed to see if an index from the
53 // collection is loaded. If no index has been loaded
54 // defaultindex is needed to load one
55 bool docTargetDocument(const text_t &defaultindex,
56 const text_t &collection,
57 int docnum,
58 text_t &output);
59
60protected:
61 querycache *cache;
62 text_t collectdir; // the collection directory
63
64 void setsearchmode (const queryparamclass &queryparams);
65 void submitquery (const queryparamclass &queryparams);
66 void getresults (queryresultsclass &queryresults);
67
68 virtual void extractquoted (text_t &ttquerystring, text_t &ttquotedquery);
69 virtual void filterquery (text_t &ttquerystring);
70};
71
72
73#endif
Note: See TracBrowser for help on using the repository browser.