34 for (
size_t i = 0; i < n_kids; ++i) {
45 for (
size_t i = 1; i < n_kids; ++i) {
46 res = max(res, plist[i]->get_termfreq_min());
55 for (
size_t i = 1; i < n_kids; ++i) {
57 if (db_size - res <= c)
73 double scale = 1.0 / db_size;
74 double P_est = plist[0]->get_termfreq_est() * scale;
75 for (
size_t i = 1; i < n_kids; ++i) {
76 double P_i = plist[i]->get_termfreq_est() * scale;
77 P_est += P_i - P_est * P_i;
99 bool doclength_set =
false;
100 for (
size_t i = 0; i < n_kids; ++i) {
101 if (plist[i]->get_docid() == did) {
103 AssertEq(doclength, plist[i]->get_doclength());
105 doclength = plist[i]->get_doclength();
106 doclength_set =
true;
119 bool unique_terms_set =
false;
120 for (
size_t i = 0; i < n_kids; ++i) {
121 if (plist[i]->get_docid() == did) {
122 if (unique_terms_set) {
123 AssertEq(unique_terms, plist[i]->get_unique_terms());
125 unique_terms = plist[i]->get_unique_terms();
126 unique_terms_set =
true;
139 for (
size_t i = 0; i < n_kids; ++i) {
140 if (plist[i]->get_docid() == did)
141 res = max(res, plist[i]->get_weight());
155 max_cached = plist[0]->recalc_maxweight();
156 for (
size_t i = 1; i < n_kids; ++i) {
157 max_cached = max(max_cached, plist[i]->recalc_maxweight());
167 for (
size_t i = 0; i < n_kids; ++i) {
171 if (cur_did <= old_did) {
173 if (old_did == 0 || cur_did == old_did) {
174 res = plist[i]->
next(w_min);
176 res = plist[i]->
skip_to(old_did + 1, w_min);
183 if (plist[i]->at_end()) {
189 matcher->recalc_maxweight();
191 cur_did = plist[i]->get_docid();
194 if (did == 0 || cur_did < did) {
212 for (
size_t i = 0; i < n_kids; ++i) {
216 if (cur_did < did_min) {
223 if (plist[i]->at_end()) {
229 matcher->recalc_maxweight();
231 cur_did = plist[i]->get_docid();
234 if (did == 0 || cur_did < did) {
251 desc += plist[0]->get_description();
252 for (
size_t i = 1; i < n_kids; ++i) {
254 desc += plist[i]->get_description();
264 for (
size_t i = 0; i < n_kids; ++i) {
265 if (plist[i]->get_docid() == did)
266 totwdf += plist[i]->get_wdf();
Abstract base class for postlists.
Xapian::docid get_docid() const
Return the current docid.
virtual Xapian::docid get_docid() const =0
Return the current docid.
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
virtual Internal * skip_to(Xapian::docid did, double w_min)=0
Skip forward to the specified docid.
double get_weight() const
Return the weight contribution for the current position.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
double doclength
A normalised document length.
Xapian::termcount get_doclength() const
Return the length of current document.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
Internal * next()
Advance the current position to the next document in the postlist.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
virtual Internal * next(double w_min)=0
Advance the current position to the next document in the postlist.
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
std::string get_description() const
Return a string description of this object.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Various assertion macros.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
N-way OR postlist with wt=max(wt_i)
bool at_end() const
Return true if the current position is past the last entry in this list.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Xapian::termcount get_wdf() const
get_wdf() for MaxPostlist returns the sum of the wdfs of the sub postlists which match the current do...