00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef OM_HGUARD_ANDMAYBEPOSTLIST_H
00029 #define OM_HGUARD_ANDMAYBEPOSTLIST_H
00030
00031 #include "branchpostlist.h"
00032
00053 class AndMaybePostList : public BranchPostList {
00054 private:
00055 Xapian::doccount dbsize;
00056 Xapian::docid lhead, rhead;
00057 Xapian::weight lmax, rmax;
00058
00059 PostList * process_next_or_skip_to(Xapian::weight w_min, PostList *ret);
00060 public:
00061 Xapian::doccount get_termfreq_max() const;
00062 Xapian::doccount get_termfreq_min() const;
00063 Xapian::doccount get_termfreq_est() const;
00064
00065 TermFreqs get_termfreq_est_using_stats(
00066 const Xapian::Weight::Internal & stats) const;
00067
00068 Xapian::docid get_docid() const;
00069 Xapian::weight get_weight() const;
00070 Xapian::weight get_maxweight() const;
00071
00072 Xapian::weight recalc_maxweight();
00073
00074 PostList *next(Xapian::weight w_min);
00075 PostList *skip_to(Xapian::docid did, Xapian::weight w_min);
00076 bool at_end() const;
00077
00078 std::string get_description() const;
00079
00083 virtual Xapian::termcount get_doclength() const;
00084
00085 AndMaybePostList(PostList *left_,
00086 PostList *right_,
00087 MultiMatch *matcher_,
00088 Xapian::doccount dbsize_)
00089 : BranchPostList(left_, right_, matcher_),
00090 dbsize(dbsize_), lhead(0), rhead(0)
00091 {
00092
00093 }
00094
00096 AndMaybePostList(PostList *left_,
00097 PostList *right_,
00098 MultiMatch *matcher_,
00099 Xapian::doccount dbsize_,
00100 Xapian::docid lhead_,
00101 Xapian::docid rhead_)
00102 : BranchPostList(left_, right_, matcher_),
00103 dbsize(dbsize_), lhead(lhead_), rhead(rhead_)
00104 {
00105
00106
00107 lmax = l->get_maxweight();
00108 rmax = r->get_maxweight();
00109 }
00110
00114 PostList * sync_rhs(Xapian::weight w_min);
00115
00120 Xapian::termcount get_wdf() const;
00121
00122 Xapian::termcount count_matching_subqs() const;
00123 };
00124
00125 #endif