36 const vector<PostList*>::const_iterator &terms_begin,
37 const vector<PostList*>::const_iterator &terms_end,
40 terms(terms_begin, terms_end)
42 size_t n =
terms.size();
46 order =
new unsigned[n];
51 for (
size_t i = 0; i < n; ++i)
order[i] =
unsigned(i);
83 return terms[a]->get_wdf() <
terms[b]->get_wdf();
90 LOGCALL(MATCH,
bool,
"ExactPhrasePostList::test_doc", NO_ARGS);
121 unsigned read_hwm = 1;
138 if (got == required) {
139 if (++i ==
terms.size()) {
161 vector<PostList *>::const_iterator i =
terms.begin();
163 while (++i !=
terms.end()) {
164 wdf = min(wdf, (*i)->get_wdf());
Class for estimating the total number of matching documents.
std::vector< PostList * > terms
bool test_doc()
Test if the current document contains the terms as an exact phrase.
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.
ExactPhrasePostList(PostList *source_, EstimateOp *estimate_op_, const std::vector< PostList * >::const_iterator &terms_begin, const std::vector< PostList * >::const_iterator &terms_end, PostListTree *pltree_)
Base class for classes which filter another PostList.
Xapian::doccount accepted
Number of times test_doc() returned true.
Xapian::doccount rejected
Number of times test_doc() returned false.
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 postlists.
Xapian::doccount get_termfreq() const
Get an estimate of the number of documents this PostList will return.
virtual std::string get_description() const =0
Return a string description of this object.
Xapian::doccount termfreq
Estimate of the number of documents this PostList will return.
Abstract base class for iterating term positions in a document.
virtual Xapian::termpos get_position() const =0
Return the current position.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
Return docs containing terms forming a particular exact phrase.
void sort(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
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.