39 PostingSource*
clone()
const override {
46 FAIL_TEST(
"MyDontUsePostingSource::get_weight() called");
51 FAIL_TEST(
"MyDontUsePostingSource::get_termfreq_min() called");
54 FAIL_TEST(
"MyDontUsePostingSource::get_termfreq_est() called");
57 FAIL_TEST(
"MyDontUsePostingSource::get_termfreq_max() called");
60 void next(
double)
override {
61 FAIL_TEST(
"MyDontUsePostingSource::next() called");
65 FAIL_TEST(
"MyDontUsePostingSource::skip_to() called");
69 FAIL_TEST(
"MyDontUsePostingSource::at_end() called");
73 FAIL_TEST(
"MyDontUsePostingSource::get_docid() called");
77 return "MyDontUsePostingSource";
108 enquire1.set_query(0 *
query);
109 mset1 = enquire1.get_mset(0, 1000);
111 enquire2.set_query(
query);
113 mset2 = enquire2.get_mset(0, 1000);
121 vector<Xapian::docid> docids;
123 docids.push_back(*mset3[i]);
125 sort(docids.begin(), docids.end());
137 while (ti1 != enquire1.get_matching_terms_end(did)) {
138 TEST(ti2 != enquire2.get_matching_terms_end(did));
147 TEST(ti2 == enquire2.get_matching_terms_end(did));
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
DEFINE_TESTCASE(boolandmaybe1, backend &&!remote)
Test that ANDMAYBE branches are ignored if their weight factor is 0.
Xapian::Database get_database(const string &dbname)
test functionality of the Xapian API
void skip_to(Xapian::docid, double) override
Advance to the specified docid.
Xapian::docid get_docid() const override
Return the current docid.
string get_description() const override
Return a string describing this object.
bool at_end() const override
Return true if the current position is past the last entry in this list.
Xapian::doccount get_termfreq_max() const override
An upper bound on the number of documents this object can return.
Xapian::doccount get_termfreq_est() const override
An estimate of the number of documents this object can return.
Xapian::doccount get_termfreq_min() const override
A lower bound on the number of documents this object can return.
PostingSource * clone() const override
Clone the posting source.
void next(double) override
Advance the current position to the next matching document.
void reset(const Xapian::Database &, Xapian::doccount) override
Set this PostingSource to the start of the list of postings.
double get_weight() const override
Return the weight contribution for the current document.
Class implementing a "boolean" weighting scheme.
An indexed database of documents.
void set_weighting_scheme(const Weight &weight)
Set the weighting scheme to use.
MSet get_mset(doccount first, doccount maxitems, doccount checkatleast=0, const RSet *rset=NULL, const MatchDecider *mdecider=NULL) const
Run the query.
TermIterator get_matching_terms_begin(docid did) const
Iterate query terms matching a document.
void set_query(const Query &query, termcount query_length=0)
Set the query.
TermIterator get_matching_terms_end(docid) const noexcept
End iterator corresponding to get_matching_terms_begin().
Class representing a list of search results.
Xapian::doccount size() const
Return number of items in this MSet object.
Base class which provides an "external" source of postings.
Class representing a query.
@ OP_AND_MAYBE
Match the first subquery taking extra weight from other subqueries.
static const Xapian::Query MatchAll
A query matching all documents.
Class for iterating over a list of terms.
void sort(_RandomAccessIterator first, _RandomAccessIterator last, _Compare comp)
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
a generic test suite engine
#define FAIL_TEST(MSG)
Fail the current testcase with message MSG.
#define TEST_EQUAL(a, b)
Test for equality of two things.
#define TEST(a)
Test a condition, without an additional explanation for failure.
Xapian-specific test helper functions and macros.
Public interfaces for the Xapian library.