21 #ifndef XAPIAN_INCLUDED_BOOLORPOSTLIST_H
22 #define XAPIAN_INCLUDED_BOOLORPOSTLIST_H
100 result += func(
plist[i].pl);
102 size_t j = 2 * i + 2;
126 #if HAVE_DECL___BUILTIN_FFS
128 i >>= __builtin_ffs(i & ~1) - 1;
147 template<
class RandomItor>
150 :
n_kids(pl_end - pl_begin)
155 std::copy(pl_begin, pl_end,
plist);
163 double scale = 1.0 / db_size;
165 for (
size_t i = 1; i <
n_kids; ++i) {
167 P_est += P_i - P_est * P_i;
PostList class implementing unweighted Query::OP_OR.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
BoolOrPostList(RandomItor pl_begin, RandomItor pl_end, Xapian::doccount db_size)
Construct from 2 random-access iterators to a container of PostList*, a pointer to the matcher,...
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
size_t n_kids
The number of sub-postlists.
bool at_end() const
Return true if the current position is past the last entry in this list.
double get_weight(Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
Return the weight contribution for the current position.
void operator=(const BoolOrPostList &)=delete
Don't allow assignment.
Xapian::termcount for_all_matches(F func) const
Helper to apply operation to all postlists matching current docid.
PostListAndDocID * plist
Array of pointers to sub-postlists.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Xapian::docid did
The current docid, or zero if we haven't started or are at_end.
std::string get_description() const
Return a string description of this object.
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 get_wdf() const
Return the wdf for the document at the current position.
void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
BoolOrPostList(const BoolOrPostList &)=delete
Don't allow copying.
Xapian::docid get_docid() const
Return the current docid.
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.
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.
bool operator>(const PostListAndDocID &o) const
PostListAndDocID(PostList *pl_)