35 max_wt =
new double [n_kids]();
46 for (
size_t i = 0; i < n_kids; ++i) {
62 for (
size_t i = 1; i < n_kids; ++i) {
64 sum += plist[i]->get_termfreq_min();
68 if (sum >= sum_old && sum <= db_size) {
84 for (
size_t i = 1; i < n_kids; ++i) {
86 if (tf < result) result = tf;
100 double result = plist[0]->get_termfreq_est();
101 for (
size_t i = 1; i < n_kids; ++i) {
102 result = (result * plist[i]->get_termfreq_est()) / db_size;
111 LOGCALL(MATCH,
TermFreqs,
"MultiAndPostList::get_termfreq_est_using_stats", stats);
115 TermFreqs freqs(plist[0]->get_termfreq_est_using_stats(stats));
117 double freqest = double(freqs.
termfreq);
119 double collfreqest = double(freqs.
collfreq);
124 for (
size_t i = 1; i < n_kids; ++i) {
125 freqs = plist[i]->get_termfreq_est_using_stats(stats);
141 static_cast<Xapian::doccount>(relfreqest + 0.5),
142 static_cast<Xapian::termcount>(collfreqest + 0.5)));
162 for (
size_t i = 1; i < n_kids; ++i) {
163 AssertEq(doclength, plist[i]->get_doclength());
173 for (
size_t i = 1; i < n_kids; ++i) {
174 AssertEq(unique_terms, plist[i]->get_unique_terms());
184 for (
size_t i = 0; i < n_kids; ++i) {
185 result += plist[i]->get_weight();
200 for (
size_t i = 0; i < n_kids; ++i) {
201 double new_max = plist[i]->recalc_maxweight();
203 max_total += new_max;
212 if (plist[0]->at_end()) {
217 for (
size_t i = 1; i < n_kids; ++i) {
219 check_helper(i, did, w_min, valid);
221 next_helper(0, w_min);
222 goto advanced_plist0;
224 if (plist[i]->at_end()) {
229 if (new_did != did) {
230 skip_to_helper(0, new_did, w_min);
231 goto advanced_plist0;
240 next_helper(0, w_min);
241 return find_next_match(w_min);
247 skip_to_helper(0, did_min, w_min);
248 return find_next_match(w_min);
255 desc += plist[0]->get_description();
256 for (
size_t i = 1; i < n_kids; ++i) {
258 desc += plist[i]->get_description();
268 for (
size_t i = 0; i < n_kids; ++i) {
269 totwdf += plist[i]->get_wdf();
278 for (
size_t i = 0; i < n_kids; ++i) {
279 total += plist[i]->count_matching_subqs();
287 for (
size_t i = 0; i < n_kids; ++i) {
288 plist[i]->gather_position_lists(orposlist);
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
void allocate_plist_and_max_wt()
Allocate plist and max_wt arrays of n_kids each.
Abstract base class for postlists.
virtual Xapian::docid get_docid() const =0
Return the current docid.
void gather_position_lists(OrPositionList *orposlist)
Gather PositionList* objects for a subtree.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
PostList * skip_to(Xapian::docid, double w_min)
Skip forward to the specified docid.
Xapian::termcount get_doclength() const
Return the length of current document.
std::string get_description() const
Return a string description of this object.
bool at_end() const
Return true if the current position is past the last entry in this list.
Xapian::docid get_docid() const
Return the current docid.
Xapian::doccount termfreq
Xapian::doccount collection_size
Number of documents in the collection.
#define AssertRelParanoid(A, REL, B)
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
PostList * find_next_match(double w_min)
Advance the sublists to the next match.
Xapian::doccount rset_size
Number of relevant documents in the collection.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Xapian::termcount get_wdf() const
get_wdf() for MultiAndPostlists returns the sum of the wdfs of the sub postlists. ...
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
double doclength
A normalised document length.
Class to hold statistics for a given collection.
Internal * next()
Advance the current position to the next document in the postlist.
Xapian::termcount collfreq
The frequencies for a term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
Various assertion macros.
double get_weight() const
Return the weight contribution for the current position.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
if(!(properties &BACKEND))
Xapian::totallength total_length
Total length of all documents in the collection.
Xapian::doccount reltermfreq
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)