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
00030
00031 class Stats;
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::valueno collapse_key;
00044
00045 int percent_cutoff;
00046
00047 Xapian::weight weight_cutoff;
00048
00049 Xapian::Enquire::docid_order order;
00050
00051 Xapian::valueno sort_key;
00052
00053 Xapian::Enquire::Internal::sort_setting sort_by;
00054
00055 bool sort_value_forward;
00056
00058 Xapian::ErrorHandler * errorhandler;
00059
00061 const Xapian::Weight * weight;
00062
00066 bool recalculate_w_max;
00067
00069 vector<bool> is_remote;
00070
00072 string get_collapse_key(PostList *pl,
00073 Xapian::docid did, Xapian::valueno keyno,
00074 Xapian::Internal::RefCntPtr<Xapian::Document::Internal> &doc);
00075
00080 Xapian::weight getorrecalc_maxweight(PostList *pl);
00081
00083 MultiMatch(const MultiMatch &);
00084
00086 void operator=(const MultiMatch &);
00087
00088 public:
00101 MultiMatch(const Xapian::Database &db_,
00102 const Xapian::Query::Internal * query,
00103 Xapian::termcount qlen,
00104 const Xapian::RSet * omrset,
00105 Xapian::valueno collapse_key_,
00106 int percent_cutoff_,
00107 Xapian::weight weight_cutoff_,
00108 Xapian::Enquire::docid_order order_,
00109 Xapian::valueno sort_key_,
00110 Xapian::Enquire::Internal::sort_setting sort_by_,
00111 bool sort_value_forward_,
00112 Xapian::ErrorHandler * errorhandler,
00113 Stats & stats,
00114 const Xapian::Weight *wtscheme,
00115 bool have_sorter, bool have_mdecider);
00116
00121 void get_mset(Xapian::doccount first,
00122 Xapian::doccount maxitems,
00123 Xapian::doccount check_at_least,
00124 Xapian::MSet & mset,
00125 const Stats & stats,
00126 const Xapian::MatchDecider * mdecider,
00127 const Xapian::MatchDecider * matchspy,
00128 const Xapian::Sorter * sorter);
00129
00133 void recalc_maxweight();
00134 };
00135
00136 #endif