34 LOGCALL(MATCH,
PostList *,
"AndNotPostList::advance_to_next_match", w_min | ret);
69 LOGCALL_CTOR(MATCH,
"AndNotPostList", left_ | right_ | matcher_ | dbsize_);
85 LOGCALL(MATCH,
PostList *,
"AndNotPostList::sync_and_skip_to",
id | w_min | lh | rh);
114 if (l_min > r_max)
RETURN(l_min - r_max);
129 RETURN(static_cast<Xapian::doccount>(est + 0.5));
136 LOGCALL(MATCH,
TermFreqs,
"AndNotPostList::get_termfreq_est_using_stats", stats);
143 double freqest, relfreqest, collfreqest;
148 freqest = lfreqs.termfreq *
151 collfreqest = lfreqs.collfreq;
153 collfreqest *= (1.0 - (double(rfreqs.collfreq) / stats.
total_length));
159 relfreqest = lfreqs.reltermfreq *
160 (1.0 - (double(rfreqs.reltermfreq) / stats.
rset_size));
164 static_cast<Xapian::doccount>(relfreqest + 0.5),
165 static_cast<Xapian::termcount>(collfreqest + 0.5)));
179 LOGCALL(MATCH,
double,
"AndNotPostList::get_weight", NO_ARGS);
187 LOGCALL(MATCH,
double,
"AndNotPostList::get_maxweight", NO_ARGS);
194 LOGCALL(MATCH,
double,
"AndNotPostList::recalc_maxweight", NO_ARGS);
203 LOGCALL(MATCH,
bool,
"AndNotPostList::at_end", NO_ARGS);
MultiMatch * matcher
The object which is using this postlist to perform a match.
Abstract base class for postlists.
double get_maxweight() const
Return an upper bound on what get_weight() can return.
Xapian::termcount get_wdf() const
get_wdf() for ANDNOT postlists returns the wdf of the left hand side.
virtual Xapian::docid get_docid() const =0
Return the current docid.
PostList * l
Left sub-postlist.
AndNotPostList(PostList *left, PostList *right, MultiMatch *matcher_, Xapian::doccount dbsize_)
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
Xapian::doccount get_termfreq_min() const
Get a lower bound on the number of documents indexed by this term.
virtual Internal * skip_to(Xapian::docid did, double w_min)=0
Skip forward to the specified docid.
virtual double recalc_maxweight()=0
Recalculate the upper bound on what get_weight() can return.
Base class for postlists which are generated by merging two sub-postlists.
static double est(double l, double r, double n)
double recalc_maxweight()
Recalculate the upper bound on what get_weight() can return.
virtual Xapian::termcount get_unique_terms() const =0
Return the number of unique terms in the current document.
Xapian::doccount collection_size
Number of documents in the collection.
bool skip_to_handling_prune(PostList *&pl, Xapian::docid did, double w_min, MultiMatch *matcher)
Xapian::doccount rset_size
Number of relevant documents in the collection.
void handle_prune(PostList *&kid, PostList *ret)
Utility method, to call recalc_maxweight() and do the pruning if a next() or skip_to() returns non-NU...
virtual Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
double get_weight() const
Return the weight contribution for the current position.
Return items which are in A, unless they're in B.
virtual Xapian::termcount get_doclength() const
Return the document length of the document the current term comes from.
virtual TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
bool at_end() const
Return true if the current position is past the last entry in this list.
virtual Xapian::doccount get_termfreq_max() const =0
Get an upper bound on the number of documents indexed by this term.
virtual Xapian::doccount get_termfreq_est() const =0
Get an estimate of the number of documents indexed by this term.
virtual Xapian::doccount get_termfreq_min() const =0
Get a lower bound on the number of documents indexed by this term.
Class to hold statistics for a given collection.
Internal * next()
Advance the current position to the next document in the postlist.
PostList * advance_to_next_match(double w_min, PostList *ret)
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
#define LOGCALL_CTOR(CATEGORY, CLASS, PARAMS)
virtual double get_maxweight() const =0
Return an upper bound on what get_weight() can return.
The frequencies for a term.
bool next_handling_prune(PostList *&pl, double w_min, MultiMatch *matcher)
virtual Internal * next(double w_min)=0
Advance the current position to the next document in the postlist.
virtual Xapian::termcount get_doclength() const =0
Return the length of current document.
virtual std::string get_description() const =0
Return a string description of this object.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
PostList * r
Right sub-postlist.
PostList * sync_and_skip_to(Xapian::docid id, double w_min, Xapian::docid lh, Xapian::docid rh)
virtual Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Xapian::doccount get_termfreq_max() const
Get an upper bound on the number of documents indexed by this term.
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
std::string get_description() const
Return a string description of this object.
virtual bool at_end() const =0
Return true if the current position is past the last entry in this list.
Xapian::doccount dbsize
Number of documents in the database this postlist is across.
Xapian::docid get_docid() const
Return the current docid.
Various assertion macros.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Xapian::termcount count_matching_subqs() const
Count the number of leaf subqueries which match at the current position.
Xapian::totallength total_length
Total length of all documents in the collection.
virtual Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
virtual double get_weight() const =0
Return the weight contribution for the current position.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)