36 for (
size_t i = 0; i < n_kids; ++i) {
56 for (
size_t i = 0; i < n_kids; ++i) {
57 if (plist[i]->get_docid() == did)
58 result += plist[i]->get_weight(doclen, unique_terms, wdfdocmax);
72 LOGCALL(MATCH,
double,
"XorPostList::recalc_maxweight", NO_ARGS);
73 double max_total = plist[0]->recalc_maxweight();
74 double min_max = max_total;
75 for (
size_t i = 1; i < n_kids; ++i) {
76 double new_max = plist[i]->recalc_maxweight();
77 if (new_max < min_max)
81 if ((n_kids & 1) == 0) {
94 size_t matching_count = 0;
96 if (old_did == 0 || plist[i]->get_docid() <= old_did) {
102 matcher->force_recalc();
105 if (plist[i]->at_end()) {
117 if (did == 0 || new_did < did) {
120 }
else if (new_did == did) {
135 if (matching_count & 1)
148 size_t matching_count = 0;
149 for (
size_t i = 0; i < n_kids; ++i) {
150 if (old_did == 0 || plist[i]->get_docid() < did_min) {
156 matcher->force_recalc();
159 if (plist[i]->at_end()) {
166 if (did == 0 || new_did < did) {
169 }
else if (new_did == did) {
185 if (matching_count & 1)
195 plist[0]->get_docid_range(first, last);
196 for (
size_t i = 1; i != n_kids; ++i) {
198 plist[i]->get_docid_range(f, l);
199 first = min(first, f);
208 desc += plist[0]->get_description();
209 for (
size_t i = 1; i < n_kids; ++i) {
211 desc += plist[i]->get_description();
221 for (
size_t i = 0; i < n_kids; ++i) {
222 if (plist[i]->get_docid() == did)
223 totwdf += plist[i]->get_wdf();
232 for (
size_t i = 0; i < n_kids; ++i) {
233 if (plist[i]->get_docid() == did)
234 total += plist[i]->count_matching_subqs();
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.
PostList * next()
Advance the current position to the next document in the postlist.
void get_docid_range(Xapian::docid &first, Xapian::docid &last) const
Get the bounds on the range of docids this PostList can return.
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.
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.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
#define UNSIGNED_OVERFLOW_OK(X)
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Various assertion macros.