source: trunk/gsdl/src/colservr/mgqueryfilter.h@ 2545

Last change on this file since 2545 was 1674, checked in by nzdl, 24 years ago

* empty log message *

  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/**********************************************************************
2 *
3 * mgqueryfilter.h -- queryfilter for old mg
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * A component of the Greenstone digital library software
7 * from the New Zealand Digital Library Project at the
8 * University of Waikato, New Zealand.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 *
24 * $Id: mgqueryfilter.h 1674 2000-11-16 03:19:13Z nzdl $
25 *
26 *********************************************************************/
27
28
29#ifndef MGQUERYFILTER_H
30#define MGQUERYFILTER_H
31
32#include "queryfilter.h"
33
34// resultsorderer_t is used to sort the query results
35struct resultsorderer_t {
36 bool compare_phrase_match;
37 bool compare_terms_match;
38 bool compare_doc_weight;
39 docresultmap *docset;
40
41 resultsorderer_t();
42 void clear();
43 bool operator()(const int &t1, const int &t2) const;
44};
45
46
47
48class mgqueryfilterclass : public queryfilterclass {
49protected:
50
51 int num_phrases;
52
53 void get_phrase_terms (const text_t &querystring,
54 const termfreqclassarray &orgterms,
55 vector<termfreqclassarray> &phrases);
56
57 // do aditional query processing
58 virtual void post_process (const queryparamclass &queryparams,
59 queryresultsclass &queryresults);
60
61 // do query that might involve multiple sub queries
62 // mgsearchptr and gdbmptr are assumed to be valid
63 void do_multi_query (const FilterRequest_t &request,
64 const vector<queryparamclass> &query_params,
65 queryresultsclass &multiresults,
66 comerror_t &err, ostream &logout);
67
68 virtual void sort_doc_results (const FilterRequest_t &request,
69 docresultsclass &docs);
70
71 virtual void mg_parse_query_params (const FilterRequest_t &request,
72 vector<queryparamclass> &query_params,
73 int &startresults, int &endresults,
74 text_t &phrasematch, ostream &logout);
75
76
77public:
78 mgqueryfilterclass ();
79 virtual ~mgqueryfilterclass ();
80
81 void filter (const FilterRequest_t &request,
82 FilterResponse_t &response,
83 comerror_t &err, ostream &logout);
84};
85
86
87#endif
88
Note: See TracBrowser for help on using the repository browser.