22 #ifndef XAPIAN_INCLUDED_XORPOSTLIST_H
23 #define XAPIAN_INCLUDED_XORPOSTLIST_H
54 for (
size_t j = i; j <
n_kids; ++j) {
64 template<
class RandomItor>
70 std::copy(pl_begin, pl_end,
plist);
77 double scale = 1.0 / db_size;
79 for (
size_t i = 1; i <
n_kids; ++i) {
81 P_est += P_i - 2.0 * P_est * P_i;
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.
PostListTree * matcher
Pointer to the matcher object, so we can report pruning.
void get_docid_range(Xapian::docid &first, Xapian::docid &last) const
Get the bounds on the range of docids this PostList can return.
Xapian::docid did
The current docid, or zero if we haven't started or are at_end.
size_t n_kids
The number of sub-postlists.
XorPostList & operator=(const XorPostList &)=delete
Don't allow assignment.
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
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.
Xapian::docid get_docid() const
Return the current docid.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
XorPostList(const XorPostList &)=delete
Don't allow copying.
bool at_end() const
Return true if the current position is past the last entry in this list.
Xapian::termcount get_wdf() const
Get the within-document frequency.
XorPostList(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,...
void erase_sublist(size_t i)
Erase a sub-postlist.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
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.
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.