37 const vector<PostList*>::const_iterator &terms_begin,
38 const vector<PostList*>::const_iterator &terms_end)
39 :
SelectPostList(source_), window(window_), terms(terms_begin, terms_end)
41 size_t n =
terms.size();
60 LOGCALL(MATCH,
bool,
"PhrasePostList::test_doc", NO_ARGS);
66 unsigned read_hwm = 0;
81 b = pos + (
terms.size() - i);
82 }
while (b - base <=
window);
96 vector<PostList *>::const_iterator i =
terms.begin();
98 while (++i !=
terms.end()) {
99 wdf = min(wdf, (*i)->get_wdf());
117 LOGCALL(MATCH,
TermFreqs,
"PhrasePostList::get_termfreq_est_using_stats", stats);
122 result.reltermfreq /= 3;
123 result.collfreq /= 3;
130 string m =
"(Phrase ";
Abstract base class for postlists.
bool test_doc()
Test if the current document contains the terms as a phrase.
Abstract base class for iterating term positions in a document.
Convert types to std::string.
Xapian::doccount termfreq
Return docs containing terms forming a particular phrase.
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
std::vector< PostList * > terms
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
virtual TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
virtual Xapian::doccount get_termfreq_est() const =0
Get an estimate of 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.
string str(int value)
Convert int to std::string.
PhrasePostList(PostList *source_, Xapian::termpos window_, const std::vector< PostList *>::const_iterator &terms_begin, const std::vector< PostList *>::const_iterator &terms_end)
std::string get_description() const
Return a string description of this object.
virtual Xapian::termpos get_position() const =0
Return the current position.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
A postlist parent class for classes which only return selected docs from a source postlist (e...
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
The frequencies for a term.
virtual std::string get_description() const =0
Return a string description of this object.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Various assertion macros.
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
Abstract base class for iterating term positions in a document.
void start_position_list(unsigned i)
Start reading from the i-th position list.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)