Ignore:
Timestamp:
2000-08-02T12:58:29+12:00 (24 years ago)
Author:
kjm18
Message:

mgpp incorporated. the old mgsearchclass and queryfilterclass are changed.
Have a base searchclass, from which mgsearchclass and mgppsearchclass inherit.
Have a base queryfilterclass, from which mgqueryfilterclass and
mgppqueryfilterclass inherit. librarymain in recpt should choose the appropriate
type (mg vs mgpp) for each collection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/queryfilter.h

    r1285 r1324  
    11/**********************************************************************
    22 *
    3  * queryfilter.h --
     3 * queryfilter.h -- abstract base class for queryfilters
     4 *          mgqueryfilter and mgppqueryfilter implement this
    45 * Copyright (C) 1999  The New Zealand Digital Library Project
    56 *
     
    3536#include "infodbclass.h"
    3637#include "maptools.h"
    37 #include "mgsearch.h"
     38#include "search.h"
    3839#include "queryinfo.h"
    39 
    40 
    41 // resultsorderer_t is used to sort the query results
    42 struct resultsorderer_t {
    43   bool compare_phrase_match;
    44   bool compare_terms_match;
    45   bool compare_doc_weight;
    46   docresultmap *docset;
    47 
    48   resultsorderer_t();
    49   void clear();
    50   bool operator()(const int &t1, const int &t2) const;
    51 };
    52 
    5340
    5441
     
    6350  gdbmclass *gdbmptr;
    6451 
    65   mgsearchclass *mgsearchptr;
     52  searchclass *mgsearchptr;
    6653 
    67   int num_phrases;
    68 
    69   void get_phrase_terms (const text_t &querystring,
    70              const termfreqclassarray &orgterms,
    71              vector<termfreqclassarray> &phrases);
    72 
    73   // do aditional query processing
    74   virtual void post_process (const queryparamclass &queryparams,
    75                  queryresultsclass &queryresults);
    76 
    77   // get the query parameters
     54   // get the query parameters
    7855  void parse_query_params (const FilterRequest_t &request,
    7956               vector<queryparamclass> &query_params,
     
    8360  // do query that might involve multiple sub queries
    8461  // mgsearchptr and gdbmptr are assumed to be valid
    85   void do_multi_query (const FilterRequest_t &request,
     62  virtual void do_multi_query (const FilterRequest_t &request,
    8663               const vector<queryparamclass> &query_params,
    8764               queryresultsclass &multiresults,
    88                comerror_t &err, ostream &logout);
     65               comerror_t &err, ostream &logout)=0;
    8966
    90   virtual void sort_doc_results (const FilterRequest_t &request,
    91                  docresultsclass &docs);
    92 
    93  
    9467public:
    9568  queryfilterclass ();
     
    10073
    10174  // the mgsearchptr remains the responsability of the calling code
    102   void set_mgsearchptr (mgsearchclass *themgsearchptr) {mgsearchptr=themgsearchptr;}
     75  void set_mgsearchptr (searchclass *themgsearchptr) {mgsearchptr=themgsearchptr;}
    10376
    104   void configure (const text_t &key, const text_tarray &cfgline);
     77  virtual void configure (const text_t &key, const text_tarray &cfgline);
    10578  bool init (ostream &logout);
     79
    10680  text_t get_filter_name () {return "QueryFilter";}
    107   void filter (const FilterRequest_t &request,
     81  bool translate(gdbmclass *gdbmptr, int docnum, text_t &trans_OID);
     82  bool need_matching_docs (int filterResultOptions);
     83  bool need_term_info (int filterResultOptions);
     84
     85
     86  virtual void filter (const FilterRequest_t &request,
    10887           FilterResponse_t &response,
    109            comerror_t &err, ostream &logout);
     88           comerror_t &err, ostream &logout)=0;
     89
     90
     91
    11092};
    11193
    11294
    11395#endif
     96
Note: See TracChangeset for help on using the changeset viewer.