22 #ifndef XAPIAN_INCLUDED_MAXPOSTLIST_H
23 #define XAPIAN_INCLUDED_MAXPOSTLIST_H
54 for (
size_t j = i; j <
n_kids; ++j) {
64 template<
class RandomItor>
70 std::copy(pl_begin, pl_end,
plist);
78 double scale = 1.0 / db_size;
80 for (
size_t i = 1; i <
n_kids; ++i) {
82 P_est += P_i - P_est * P_i;
N-way OR postlist with wt=max(wt_i).
MaxPostList(const MaxPostList &)
Don't allow copying.
void operator=(const MaxPostList &)
Don't allow assignment.
void get_docid_range(Xapian::docid &first, Xapian::docid &last) const
Get the bounds on the range of docids this PostList can return.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
void erase_sublist(size_t i)
Erase a sub-postlist.
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
Xapian::docid did
The current docid, or zero if we haven't started or are at_end.
bool at_end() const
Return true if the current position is past the last entry in this list.
PositionList * read_position_list()
Read the position list for the term in the current document and return a pointer to it (owned by the ...
PostList ** plist
Array of pointers to sub-postlists.
Xapian::termcount get_wdf() const
get_wdf() for MaxPostlist returns the sum of the wdfs of the sub postlists which match the current do...
Xapian::docid get_docid() const
Return the current docid.
size_t n_kids
The number of sub-postlists.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
std::string get_description() const
Return a string description of this object.
PostListTree * matcher
Pointer to the matcher object, so we can report pruning.
MaxPostList(RandomItor pl_begin, RandomItor pl_end, PostListTree *matcher_, Xapian::doccount db_size)
Construct from 2 random-access iterators to a container of PostList*, a pointer to the matcher,...
Abstract base class for postlists.
Xapian::doccount get_termfreq() const
Get an estimate of the number of documents this PostList will return.
PostList * next()
Advance the current position to the next document in the postlist.
Xapian::doccount termfreq
Estimate of the number of documents this PostList will return.
Abstract base class for iterating term positions in a document.
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.
Abstract base class for postlists.
Class for managing a tree of PostList objects.