55 "Term(pos, wdf=2, pos=[2, 3]), " 64 "Term(pos, wdf=2, pos=[2, 3]), " 66 "Term(pos3, wdf=2, pos=[1, 5])");
74 "Term(pos3, wdf=2, pos=[1, 5])");
112 return ", Term(z0, wdf=0), Term(z1, wdf=1)";
194 doc4.add_term(
"takeaway", 1);
Xapian::Document get_document(Xapian::docid did) const
Get a document from the database, given its document id.
Xapian::docid add_document(const Xapian::Document &document)
Add a new document to the database.
PositionIterator positionlist_end(Xapian::docid, const std::string &) const
Corresponding end iterator to positionlist_begin().
void dbcheck(const Xapian::Database &db, Xapian::doccount expected_doccount, Xapian::docid expected_lastdocid)
Check consistency of database and statistics.
#define TEST(a)
Test a condition, without an additional explanation for failure.
Xapian::termcount termlist_count() const
The length of the termlist - i.e.
test database contents and consistency.
PositionIterator positionlist_begin(Xapian::docid did, const std::string &tname) const
An iterator pointing to the start of the position list for a given term in a given document...
Xapian::WritableDatabase get_writable_database(const string &dbname)
Xapian::docid get_lastdocid() const
Get the highest document id which has been used in the database.
a generic test suite engine
void remove_term(const std::string &tname)
Remove a term and all postings associated with it.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
string docstats_to_string(const Xapian::Database &db, Xapian::docid did)
Convert statistics about a document to a string.
test functionality of the Xapian API
Xapian::doclength get_avlength() const
Get the average length of the documents in the database.
string docterms_to_string(const Xapian::Database &db, Xapian::docid did)
Convert the list of terms in a document to a string.
string postlist_to_string(const Xapian::Database &db, const string &tname)
Convert the list of postings in a postlist to a string.
static string basic_docterms()
string termstats_to_string(const Xapian::Database &db, const string &term)
Convert statistics about a term to a string.
This class provides read/write access to a database.
Public interfaces for the Xapian library.
void delete_document(Xapian::docid did)
Delete a document from the database.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
void commit()
Commit any pending modifications made to the database.
Class for iterating over term positions.
Indicates an attempt to access a document not present in the database.
void add_posting(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1)
Add an occurrence of a term at a particular position.
Xapian-specific test helper functions and macros.
DEFINE_TESTCASE(poslistupdate1, positional &&writable)
#define TEST_EQUAL(a, b)
Test for equality of two things.
A handle representing a document in a Xapian database.
static Xapian::Document basic_doc()
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.