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
00029 #ifndef OM_HGUARD_ANDMAYBEPOSTLIST_H
00030 #define OM_HGUARD_ANDMAYBEPOSTLIST_H
00031
00032 #include "branchpostlist.h"
00033
00054 class AndMaybePostList : public BranchPostList {
00055 private:
00056 Xapian::doccount dbsize;
00057 Xapian::docid lhead, rhead;
00058 Xapian::weight lmax, rmax;
00059
00060 PostList * process_next_or_skip_to(Xapian::weight w_min, PostList *ret);
00061 public:
00062 Xapian::doccount get_termfreq_max() const;
00063 Xapian::doccount get_termfreq_min() const;
00064 Xapian::doccount get_termfreq_est() const;
00065
00066 Xapian::docid get_docid() const;
00067 Xapian::weight get_weight() const;
00068 Xapian::weight get_maxweight() const;
00069
00070 Xapian::weight recalc_maxweight();
00071
00072 PostList *next(Xapian::weight w_min);
00073 PostList *skip_to(Xapian::docid did, Xapian::weight w_min);
00074 bool at_end() const;
00075
00076 std::string get_description() const;
00077
00081 virtual Xapian::doclength get_doclength() const;
00082
00083 AndMaybePostList(PostList *left_,
00084 PostList *right_,
00085 MultiMatch *matcher_,
00086 Xapian::doccount dbsize_)
00087 : BranchPostList(left_, right_, matcher_),
00088 dbsize(dbsize_), lhead(0), rhead(0)
00089 {
00090
00091 }
00092
00094 AndMaybePostList(PostList *left_,
00095 PostList *right_,
00096 MultiMatch *matcher_,
00097 Xapian::doccount dbsize_,
00098 Xapian::docid lhead_,
00099 Xapian::docid rhead_)
00100 : BranchPostList(left_, right_, matcher_),
00101 dbsize(dbsize_), lhead(lhead_), rhead(rhead_)
00102 {
00103
00104
00105 lmax = l->get_maxweight();
00106 rmax = r->get_maxweight();
00107 }
00108 };
00109
00110 #endif