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)";
static Xapian::Document basic_doc()
static string basic_docterms()
DEFINE_TESTCASE(poslistupdate1, positional &&writable)
Xapian::WritableDatabase get_writable_database(const string &dbname)
test functionality of the Xapian API
Xapian::doclength get_avlength() const
Get the average length of the documents in the database.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
Xapian::Document get_document(Xapian::docid did) const
Get a document from the database, given its document id.
Xapian::docid get_lastdocid() const
Get the highest document id which has been used in the database.
PositionIterator positionlist_end(Xapian::docid, const std::string &) const
Corresponding end iterator to positionlist_begin().
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.
Indicates an attempt to access a document not present in the database.
A handle representing a document in a Xapian database.
void remove_term(const std::string &tname)
Remove a term and all postings associated with it.
void add_posting(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1)
Add an occurrence of a term at a particular position.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.
Xapian::termcount termlist_count() const
The length of the termlist - i.e.
Class for iterating over term positions.
This class provides read/write access to a database.
void delete_document(Xapian::docid did)
Delete a document from the database.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
void commit()
Commit any pending modifications made to the database.
Xapian::docid add_document(const Xapian::Document &document)
Add a new document to the database.
test database contents and consistency.
string docterms_to_string(const Xapian::Database &db, Xapian::docid did)
Convert the list of terms in a document to a string.
void dbcheck(const Xapian::Database &db, Xapian::doccount expected_doccount, Xapian::docid expected_lastdocid)
Check consistency of database and statistics.
string postlist_to_string(const Xapian::Database &db, const string &tname)
Convert the list of postings in a postlist to a string.
string termstats_to_string(const Xapian::Database &db, const string &term)
Convert statistics about a term to a string.
string docstats_to_string(const Xapian::Database &db, Xapian::docid did)
Convert statistics about a document to a string.
a generic test suite engine
#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.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
Public interfaces for the Xapian library.