66 doc.add_value(0,
"world");
67 doc.add_value(1,
"cheese");
84 if (db_w.
size() > 1) {
103 doc.add_value(1,
"newval");
156 doc.add_value(0,
"world");
157 doc.add_value(1,
"cheese");
190 if (db_w.
size() > 1) {
212 doc.add_value(1,
"newval");
272 size_t FLUSH_THRESHOLD = 10000;
276 FLUSH_THRESHOLD *= db_w.
size();
279 for (
size_t i = 0; i < FLUSH_THRESHOLD; ++i) {
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.
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.
This class is used to access a database, or a group of databases.
ValueIterator values_begin() const
Iterator for the values in this document.
Xapian::WritableDatabase get_writable_database(const string &dbname)
void begin_transaction(bool flushed=true)
Begin a transaction.
a generic test suite engine
bool reopen()
Re-open the database.
Class for iterating over document values.
std::string get_value_upper_bound(Xapian::valueno slot) const
Get an upper bound on the values stored in the given value slot.
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.
void remove_value(Xapian::valueno slot)
Remove any value with the given number.
test functionality of the Xapian API
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.
void commit()
Commit any pending modifications made to the database.
Xapian::Database get_writable_database_as_database()
ValueIterator values_end() const
Equivalent end iterator for values_begin().
size_t size() const
Return number of shards in this Database object.
Xapian::Database get_database(const string &dbname)
DEFINE_TESTCASE(valuestats1, writable &&valuestats)
Test of value statistics methods.
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.
#define TEST_EQUAL(a, b)
Test for equality of two things.
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.