22 #ifndef XAPIAN_INCLUDED_MULTIANDPOSTLIST_H
23 #define XAPIAN_INCLUDED_MULTIANDPOSTLIST_H
121 template<
class RandomItor>
138 double lmax,
double rmax,
148 std::swap(lmax, rmax);
PostList ** plist
Array of pointers to sub-postlists.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
Xapian::docid did
The current docid, or zero if we haven't started or are at_end.
PostList * find_next_match(double w_min)
Advance the sublists to the next match.
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
double get_weight() const
Return the weight contribution for the current position.
MultiAndPostList(RandomItor pl_begin, RandomItor pl_end, MultiMatch *matcher_, Xapian::doccount db_size_)
Construct from 2 random-access iterators to a container of PostList*, a pointer to the matcher,...
MultiMatch * matcher
Pointer to the matcher object, so we can report pruning.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
MultiAndPostList(PostList *l, PostList *r, double lmax, double rmax, MultiMatch *matcher_, Xapian::doccount db_size_)
Construct as the decay product of an OrPostList or AndMaybePostList.
size_t n_kids
The number of sub-postlists.
Xapian::termcount get_wdf() const
get_wdf() for MultiAndPostlists returns the sum of the wdfs of the sub postlists.
void operator=(const MultiAndPostList &)
Don't allow assignment.
double max_total
Total maximum weight (== sum of max_wt values).
void skip_to_helper(size_t n, Xapian::docid did_min, double w_min)
Call skip_to on a sub-postlist n, and handle any pruning.
Xapian::termcount get_doclength() const
Return the length of current document.
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
void next_helper(size_t n, double w_min)
Call next on a sub-postlist n, and handle any pruning.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Xapian::docid get_docid() const
Return the current docid.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
double new_min(double w_min, size_t n)
Calculate the new minimum weight for sub-postlist n.
void allocate_plist_and_max_wt()
Allocate plist and max_wt arrays of n_kids each.
MultiAndPostList(const MultiAndPostList &)
Don't allow copying.
double * max_wt
Array of maximum weights for the sub-postlists.
Xapian::doccount db_size
The number of documents in the database.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
void check_helper(size_t n, Xapian::docid did_min, double w_min, bool &valid)
Call check on a sub-postlist n, and handle any pruning.
std::string get_description() const
Return a string description of this object.
bool at_end() const
Return true if the current position is past the last entry in this list.
void recalc_maxweight()
Called by postlists to indicate that they've rearranged themselves and the maxweight now possible is ...
Abstract base class for postlists.
virtual Xapian::doccount get_termfreq_est() const =0
Get an estimate of the number of documents indexed by this term.
virtual Internal * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
virtual Internal * next(double w_min)=0
Advance the current position to the next document in the postlist.
Internal * next()
Advance the current position to the next document in the postlist.
virtual Internal * skip_to(Xapian::docid did, double w_min)=0
Skip forward to the specified docid.
Class to hold statistics for a given collection.
class for performing a match
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Various assertion macros.
Abstract base class for postlists.
Comparison functor which orders PostList* by ascending get_termfreq_est().
bool operator()(const PostList *a, const PostList *b) const
Order by ascending get_termfreq_est().
The frequencies for a term.