00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef OM_HGUARD_MULTIMATCH_H
00023 #define OM_HGUARD_MULTIMATCH_H
00024
00025 #include "omqueryinternal.h"
00026 #include "submatch.h"
00027
00028 #include <vector>
00029 #include <map>
00030
00031
00032 class Stats;
00033
00034 class MultiMatch
00035 {
00036 private:
00038 std::vector<Xapian::Internal::RefCntPtr<SubMatch> > leaves;
00039
00040 const Xapian::Database db;
00041
00042 const Xapian::Query::Internal *query;
00043
00044 Xapian::valueno collapse_key;
00045
00046 int percent_cutoff;
00047
00048 Xapian::weight weight_cutoff;
00049
00050 Xapian::Enquire::docid_order order;
00051
00052 Xapian::valueno sort_key;
00053
00054 Xapian::Enquire::Internal::sort_setting sort_by;
00055
00056 bool sort_value_forward;
00057
00058 const Xapian::Sorter * sorter;
00059
00061 Xapian::ErrorHandler * errorhandler;
00062
00064 const Xapian::Weight * weight;
00065
00069 bool recalculate_w_max;
00070
00072 vector<bool> is_remote;
00073
00075 string get_collapse_key(PostList *pl,
00076 Xapian::docid did, Xapian::valueno keyno,
00077 Xapian::Internal::RefCntPtr<Xapian::Document::Internal> &doc);
00078
00083 Xapian::weight getorrecalc_maxweight(PostList *pl);
00084
00086 MultiMatch(const MultiMatch &);
00087
00089 void operator=(const MultiMatch &);
00090
00091 public:
00103 MultiMatch(const Xapian::Database &db_,
00104 const Xapian::Query::Internal * query,
00105 Xapian::termcount qlen,
00106 const Xapian::RSet * omrset,
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 const Xapian::Sorter * sorter_,
00115 Xapian::ErrorHandler * errorhandler,
00116 Stats & stats,
00117 const Xapian::Weight *wtscheme);
00118
00119 void get_mset(Xapian::doccount first,
00120 Xapian::doccount maxitems,
00121 Xapian::doccount check_at_least,
00122 Xapian::MSet & mset,
00123 const Stats & stats,
00124 const Xapian::MatchDecider * mdecider,
00125 const Xapian::MatchDecider * matchspy);
00126
00130 void recalc_maxweight();
00131 };
00132
00133 #endif