54 "Term(pos, wdf=2, pos=[2, 3]), "
63 "Term(pos, wdf=2, pos=[2, 3]), "
65 "Term(pos3, wdf=2, pos=[1, 5])");
73 "Term(pos3, wdf=2, pos=[1, 5])");
111 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
PositionIterator positionlist_end(Xapian::docid, std::string_view) const noexcept
End iterator corresponding to positionlist_begin().
double get_avlength() const
Old name for get_average_length() for backward compatibility.
PositionIterator positionlist_begin(Xapian::docid did, std::string_view term) const
Start iterating positions for a term in a document.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
Xapian::docid get_lastdocid() const
Get the highest document id which has been used in the database.
Xapian::Document get_document(Xapian::docid did, unsigned flags=0) const
Get a document from the database.
Indicates an attempt to access a document not present in the database.
Class representing a document.
void add_boolean_term(std::string_view term)
Add a boolean filter term to the document.
void add_term(std::string_view term, Xapian::termcount wdf_inc=1)
Add a term to this document.
void remove_term(std::string_view term)
Remove a term from this document.
void add_posting(std::string_view term, Xapian::termpos term_pos, Xapian::termcount wdf_inc=1)
Add a posting for a term.
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 document in the database.
void commit()
Commit pending modifications.
Xapian::docid add_document(const Xapian::Document &doc)
Add a 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.