00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef XAPIAN_INCLUDED_LOCALSUBMATCH_H
00023 #define XAPIAN_INCLUDED_LOCALSUBMATCH_H
00024
00025 #include "database.h"
00026 #include "debuglog.h"
00027 #include "omqueryinternal.h"
00028 #include "submatch.h"
00029 #include "xapian/enquire.h"
00030 #include "xapian/weight.h"
00031
00032 #include <map>
00033
00034 class LocalSubMatch : public SubMatch {
00036 void operator=(const LocalSubMatch &);
00037
00039 LocalSubMatch(const LocalSubMatch &);
00040
00042 const Xapian::Weight::Internal * stats;
00043
00045 const Xapian::Query::Internal * query;
00046
00048 Xapian::termcount qlen;
00049
00051 const Xapian::Database::Internal *db;
00052
00057 Xapian::RSet rset;
00058
00060 const Xapian::Weight * wt_factory;
00061
00063 std::map<std::string,
00064 Xapian::MSet::Internal::TermFreqAndWeight> * term_info;
00065
00066 public:
00068 LocalSubMatch(const Xapian::Database::Internal *db_,
00069 const Xapian::Query::Internal * query_,
00070 Xapian::termcount qlen_,
00071 const Xapian::RSet & rset_,
00072 const Xapian::Weight *wt_factory_)
00073 : stats(NULL), query(query_), qlen(qlen_), db(db_), rset(rset_),
00074 wt_factory(wt_factory_), term_info(NULL)
00075 {
00076 LOGCALL_CTOR(MATCH, "LocalSubMatch", db_ | query_ | qlen_ | rset_ | wt_factory_);
00077 }
00078
00080 bool prepare_match(bool nowait, Xapian::Weight::Internal & total_stats);
00081
00083 void start_match(Xapian::doccount first,
00084 Xapian::doccount maxitems,
00085 Xapian::doccount check_at_least,
00086 const Xapian::Weight::Internal & total_stats);
00087
00089 PostList * get_postlist_and_term_info(MultiMatch *matcher,
00090 std::map<std::string,
00091 Xapian::MSet::Internal::TermFreqAndWeight> *termfreqandwts,
00092 Xapian::termcount * total_subqs_ptr);
00093
00096 PostList * make_synonym_postlist(PostList * or_pl, MultiMatch * matcher,
00097 double factor);
00098
00103 PostList * postlist_from_op_leaf_query(const Xapian::Query::Internal *query,
00104 double factor);
00105 };
00106
00107 #endif