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);
67 explicit TermCompare(vector<PostList *> & terms_) : terms(terms_) { }
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);
170 result.reltermfreq /= 4;
171 result.collfreq /= 4;
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 postlists.
Return docs containing terms forming a particular exact phrase.
TermCompare(vector< PostList *> &terms_)
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.
Abstract base class for iterating term positions in a document.
bool operator()(unsigned a, unsigned b) const
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
Xapian::doccount termfreq
Xapian::doccount get_termfreq_est() const
Get an estimate of the number of documents indexed by this term.
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.
ExactPhrasePostList(PostList *source_, const std::vector< PostList *>::const_iterator &terms_begin, const std::vector< PostList *>::const_iterator &terms_end)
Class to hold statistics for a given collection.
bool test_doc()
Test if the current document contains the terms as an exact phrase.
virtual Xapian::termpos get_position() const =0
Return 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.
std::vector< PostList * > terms
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.
Abstract base class for iterating term positions in a document.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)