36 for (
size_t i = 0; i < n_kids; ++i) {
67 while (plist[0].did == did) {
74 if (plist[0].pl->at_end()) {
81 Heap::pop(plist, plist + n_kids, std::greater<PostListAndDocID>());
82 delete plist[--n_kids].pl;
85 plist[0].did = plist[0].pl->get_docid();
86 Heap::replace(plist, plist + n_kids, std::greater<PostListAndDocID>());
102 if (
rare(did_min <= did))
return NULL;
105 for (
size_t i = 0; i < n_kids; ++i) {
106 if (plist[i].did < did_min) {
112 plist[j].pl = plist[i].pl;
115 if (plist[j].pl->at_end()) {
116 if (j == 0 && i == n_kids - 1) {
130 did = min(did, plist[j].did);
143 Heap::make(plist, plist + n_kids, std::greater<PostListAndDocID>());
161 plist[0].pl->get_docid_range(first, last);
162 for (
size_t i = 1; i != n_kids; ++i) {
164 plist[i].pl->get_docid_range(f, l);
165 first = min(first, f);
173 string desc =
"BoolOrPostList(";
174 desc += plist[0].pl->get_description();
175 for (
size_t i = 1; i < n_kids; ++i) {
177 desc += plist[i].pl->get_description();
186 return for_all_matches([](
PostList* pl) {
194 return for_all_matches([](
PostList* pl) {
202 for_all_matches([&orposlist](
PostList* pl) {
PostList class implementing unweighted Query::OP_OR.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
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.
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.
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.
Xapian::docid get_docid() const
Return the current docid.
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::termcount get_wdf() const
Return the wdf for the document at the current position.
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 void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
virtual Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
C++ STL heap implementation with extensions.
void pop(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
void replace(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
void make(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Class for managing a tree of PostList objects.