00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef OM_HGUARD_MULTIMATCH_H
00024 #define OM_HGUARD_MULTIMATCH_H
00025
00026 #include "omqueryinternal.h"
00027 #include "submatch.h"
00028
00029 #include <vector>
00030
00031 #include "xapian/weight.h"
00032
00033 class MultiMatch
00034 {
00035 private:
00037 std::vector<Xapian::Internal::RefCntPtr<SubMatch> > leaves;
00038
00039 const Xapian::Database db;
00040
00041 const Xapian::Query::Internal *query;
00042
00043 Xapian::doccount collapse_max;
00044
00045 Xapian::valueno collapse_key;
00046
00047 int percent_cutoff;
00048
00049 Xapian::weight weight_cutoff;
00050
00051 Xapian::Enquire::docid_order order;
00052
00053 Xapian::valueno sort_key;
00054
00055 Xapian::Enquire::Internal::sort_setting sort_by;
00056
00057 bool sort_value_forward;
00058
00060 Xapian::ErrorHandler * errorhandler;
00061
00063 const Xapian::Weight * weight;
00064
00068 bool recalculate_w_max;
00069
00071 vector<bool> is_remote;
00072
00074 const vector<Xapian::MatchSpy *> & matchspies;
00075
00080 Xapian::weight getorrecalc_maxweight(PostList *pl);
00081
00083 MultiMatch(const MultiMatch &);
00084
00086 void operator=(const MultiMatch &);
00087
00088 public:
00102 MultiMatch(const Xapian::Database &db_,
00103 const Xapian::Query::Internal * query,
00104 Xapian::termcount qlen,
00105 const Xapian::RSet * omrset,
00106 Xapian::doccount collapse_max_,
00107 Xapian::valueno collapse_key_,
00108 int percent_cutoff_,
00109 Xapian::weight weight_cutoff_,
00110 Xapian::Enquire::docid_order order_,
00111 Xapian::valueno sort_key_,
00112 Xapian::Enquire::Internal::sort_setting sort_by_,
00113 bool sort_value_forward_,
00114 Xapian::ErrorHandler * errorhandler,
00115 Xapian::Weight::Internal & stats,
00116 const Xapian::Weight *wtscheme,
00117 const vector<Xapian::MatchSpy *> & matchspies_,
00118 bool have_sorter, bool have_mdecider);
00119
00124 void get_mset(Xapian::doccount first,
00125 Xapian::doccount maxitems,
00126 Xapian::doccount check_at_least,
00127 Xapian::MSet & mset,
00128 const Xapian::Weight::Internal & stats,
00129 const Xapian::MatchDecider * mdecider,
00130 const Xapian::MatchDecider * matchspy_legacy,
00131 const Xapian::KeyMaker * sorter);
00132
00136 void recalc_maxweight() {
00137 recalculate_w_max = true;
00138 }
00139 };
00140
00141 #endif