34 pl =
new AndPostList(pl, r, pl_max, r_max, pltree, termfreq);
38 result = pl->
check(did, w_min, *valid_ptr);
40 result = pl->
skip_to(did, w_min);
46 pltree->force_recalc();
61 auto res = pl->get_weight(doclen, unique_terms, wdfdocmax);
63 res += r->get_weight(doclen, unique_terms, wdfdocmax);
70 pl_max = pl->recalc_maxweight();
71 r_max = r->recalc_maxweight();
72 return pl_max + r_max;
79 return decay_to_and(max(pl_did, r_did) + 1, w_min);
89 pltree->force_recalc();
96 result = r->
check(pl_did, w_min - pl_max, r_valid);
106 pltree->force_recalc();
121 if (w_min > pl_max) {
123 return decay_to_and(max(did, r_did), w_min);
134 pltree->force_recalc();
138 if (pl_did > r_did) {
140 result = r->
check(pl_did, 0, r_valid);
150 pltree->force_recalc();
162 return decay_to_and(max({did, pl_did, r_did}), w_min, &valid);
173 pltree->force_recalc();
177 if (pl_did > r_did) {
179 result = r->
check(pl_did, 0, r_valid);
189 pltree->force_recalc();
201 string desc =
"AndMaybePostList(";
202 desc += pl->get_description();
204 desc += r->get_description();
212 auto res = pl->get_wdf();
221 auto res = pl->count_matching_subqs();
223 res += r->count_matching_subqs();
230 pl->gather_position_lists(orposlist);
232 r->gather_position_lists(orposlist);
PostList class implementing Query::OP_AND_MAYBE.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
PostList * decay_to_and(Xapian::docid did, double w_min, bool *valid_ptr=NULL)
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
Xapian::docid get_docid() const
Return the current docid.
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
std::string get_description() const
Return a string description of this object.
PostList * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
Abstract base class for postlists.
virtual PostList * skip_to(Xapian::docid did, double w_min)=0
Skip forward to the specified docid.
virtual PostList * next(double w_min)=0
Advance the current position to the next document in the postlist.
virtual Xapian::docid get_docid() const =0
Return the current docid.
PostList * next()
Advance the current position to the next document in the postlist.
virtual PostList * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.