source: trunk/gsdl/src/colservr/queryinfo.h@ 110

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

Moved from src/library.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1/**********************************************************************
2 *
3 * queryinfo.h --
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: queryinfo.h 110 1999-01-08 09:02:22Z rjmcnab $
9 *
10 *********************************************************************/
11
12
13#ifndef QUERYINFO_H
14#define QUERYINFO_H
15
16
17#include "text_t.h"
18
19#ifndef USE_OBJECTSPACE
20# include <vector>
21# include <algorithm>
22#else
23# include <ospace\std\vector>
24# include <ospace\std\algorithm>
25#endif
26
27// query parameters
28
29class queryparamclass
30{
31public:
32 text_t collection;
33 text_t search_index;
34 text_t querystring;
35 int search_type; // 0 = boolean, 1 = ranked
36 int casefolding;
37 int stemming;
38 int maxdocs;
39
40 queryparamclass &operator=(const queryparamclass &q);
41};
42
43bool operator==(const queryparamclass &x, const queryparamclass &y);
44bool operator!=(const queryparamclass &x, const queryparamclass &y);
45
46// stream output for debugging purposes
47ostream &operator<< (ostream &outs, queryparamclass &q);
48
49
50
51// term frequencies
52
53class termfreqclass
54{
55public:
56 text_t termstr;
57 unsigned int termfreq;
58
59 termfreqclass &operator=(const termfreqclass &t);
60};
61
62bool operator==(const termfreqclass &x, const termfreqclass &y);
63bool operator!=(const termfreqclass &x, const termfreqclass &y);
64bool operator<(const termfreqclass &x, const termfreqclass &y);
65bool operator>(const termfreqclass &x, const termfreqclass &y);
66
67// stream output for debugging purposes
68ostream &operator<< (ostream &outs, termfreqclass &q);
69
70
71
72// one query result
73
74class docresultclass
75{
76public:
77 int docnum;
78 float docweight;
79};
80
81// stream output for debugging purposes
82ostream &operator<< (ostream &outs, docresultclass &a);
83
84
85
86// query results
87
88class queryresultsclass
89{
90public:
91 vector<docresultclass> docs;
92 vector<termfreqclass> terms;
93 vector<text_t> termvariants;
94
95 void clear ();
96 queryresultsclass &operator=(const queryresultsclass &q);
97
98 int getnumdocs () {return docs.size();}
99 int getnumterms () {return terms.size();}
100
101 void sortqueryterms();
102 void uniqqueryterms();
103};
104
105// stream output for debugging purposes
106ostream &operator<< (ostream &outs, queryresultsclass &q);
107
108
109#endif
Note: See TracBrowser for help on using the repository browser.