84 if (db_w.
size() > 1) {
190 if (db_w.
size() > 1) {
272 size_t FLUSH_THRESHOLD = 10000;
276 FLUSH_THRESHOLD *= db_w.
size();
279 for (
size_t i = 0; i < FLUSH_THRESHOLD; ++i) {
337 for (
int i = 0; i < 24; ++i) {
349 for (
int i = 0; i < 24; ++i) {
DEFINE_TESTCASE(valuestats1, writable &&valuestats)
Test of value statistics methods.
static void gen_valuestats6_db(Xapian::WritableDatabase &wdb, const string &)
Xapian::Database get_writable_database_as_database()
Xapian::WritableDatabase get_writable_database(const string &dbname)
Xapian::Database get_database(const string &dbname)
test functionality of the Xapian API
An indexed database of documents.
size_t size() const
Return number of shards in this Database object.
std::string get_value_upper_bound(Xapian::valueno slot) const
Get an upper bound on the values stored in the given value slot.
std::string get_value_lower_bound(Xapian::valueno slot) const
Get a lower bound on the values stored in the given value slot.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
Xapian::doccount get_value_freq(Xapian::valueno slot) const
Return the frequency of a given value slot.
bool reopen()
Reopen the database at the latest available revision.
Xapian::Document get_document(Xapian::docid did, unsigned flags=0) const
Get a document from the database.
Class representing a document.
ValueIterator values_begin() const
Start iterating the values in this document.
void remove_value(Xapian::valueno slot)
Remove any value from the specified slot.
ValueIterator values_end() const noexcept
End iterator corresponding to values_begin().
void add_value(Xapian::valueno slot, std::string_view value)
Add a value to a slot in this document.
Class for iterating over document values.
Xapian::valueno get_valueno() const
Return the value slot number for the current position.
This class provides read/write access to a database.
void delete_document(Xapian::docid did)
Delete a document from the database.
void begin_transaction(bool flushed=true)
Begin a transaction.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a document in the database.
void cancel_transaction()
Abort the transaction currently in progress.
void commit()
Commit pending modifications.
Xapian::docid add_document(const Xapian::Document &doc)
Add a document to the database.
string str(int value)
Convert int to std::string.
unsigned valueno
The number for a value slot in a document.
Convert types to std::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.
Public interfaces for the Xapian library.