118 doc.add_term(
"befuddlement");
142 size_t check_errors =
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.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
static size_t check(const std::string &path, int opts=0, std::ostream *out=NULL)
Check the integrity of a database or database table.
void cancel_transaction()
Abort the transaction currently in progress, discarding the pending modifications made to the databas...
#define TEST(a)
Test a condition, without an additional explanation for failure.
DEFINE_TESTCASE(badtransaction1, transactions)
Test incorrect uses of the transaction API lead to errors.
InvalidOperationError indicates the API was used in an invalid way.
Xapian::WritableDatabase get_writable_database(const string &dbname)
void begin_transaction(bool flushed=true)
Begin a transaction.
std::string get_value_upper_bound(Xapian::valueno slot) const
Get an upper bound on the values stored in the given value slot.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
Xapian::WritableDatabase get_named_writable_database(const std::string &name, const std::string &source)
test functionality of the Xapian API
std::string get_named_writable_database_path(const std::string &name)
This class provides read/write access to a database.
std::ostringstream tout
The debug printing stream.
Public interfaces for the Xapian library.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
void commit()
Commit any pending modifications made to the database.
bool term_exists(const std::string &tname) const
Check if a given term exists in the database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
std::string get_value_lower_bound(Xapian::valueno slot) const
Get a lower bound on the values stored in the given value slot.
Xapian-specific test helper functions and macros.
void commit_transaction()
Complete the transaction currently in progress.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
#define TEST_EQUAL(a, b)
Test for equality of two things.
void set_data(const std::string &data)
Set data stored in the document.
Xapian::doccount get_termfreq(const std::string &tname) const
Get the number of documents in the database indexed by a given term.
Xapian::doccount get_value_freq(Xapian::valueno slot) const
Return the frequency of a given value slot.
A handle representing a document in a Xapian database.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.
const int DBCHECK_SHOW_STATS
Show statistics for the B-tree.