35 const vector<PostList*>::const_iterator &terms_begin,
36 const vector<PostList*>::const_iterator &terms_end)
39 size_t n =
terms.size();
43 order =
new unsigned[n];
48 for (
size_t i = 0; i < n; ++i)
order[i] =
unsigned(i);
70 return terms[a]->get_wdf() <
terms[b]->get_wdf();
77 LOGCALL(MATCH,
bool,
"ExactPhrasePostList::test_doc", NO_ARGS);
104 unsigned read_hwm = 1;
121 if (got == required) {
139 vector<PostList *>::const_iterator i =
terms.begin();
141 while (++i !=
terms.end()) {
142 wdf = min(wdf, (*i)->get_wdf());
165 LOGCALL(MATCH,
TermFreqs,
"ExactPhrasePostList::get_termfreq_est_using_stats", stats);
std::vector< PostList * > terms
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
bool test_doc()
Test if the current document contains the terms as an exact phrase.
TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
ExactPhrasePostList(PostList *source_, const std::vector< PostList * >::const_iterator &terms_begin, const std::vector< PostList * >::const_iterator &terms_end)
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
void start_position_list(unsigned i)
Start reading from the i-th position list.
std::string get_description() const
Return a string description of this object.
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.
TermCompare(vector< PostList * > &terms_)
bool operator()(unsigned a, unsigned b) const
vector< PostList * > & terms
Abstract base class for iterating term positions in a document.
virtual Xapian::termpos get_position() const =0
Return the current position.
Abstract base class for postlists.
virtual std::string get_description() const =0
Return a string description of this object.
virtual Xapian::doccount get_termfreq_est() const =0
Get an estimate of the number of documents indexed by this term.
virtual TermFreqs get_termfreq_est_using_stats(const Xapian::Weight::Internal &stats) const
Get an estimate for the termfreq and reltermfreq, given the stats.
Class to hold statistics for a given collection.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
Return docs containing terms forming a particular exact phrase.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
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.
Abstract base class for iterating term positions in a document.
The frequencies for a term.
Xapian::termcount collfreq
Xapian::doccount reltermfreq
Xapian::doccount termfreq