41 unsigned int runsize = 1000000;
44 std::map<std::string, std::string> params;
45 params[
"runsize"] =
str(runsize);
47 for (
unsigned int i = 0; i < runsize; ++i) {
48 unsigned int v = i % 100;
53 if (vs.size() == 1) vs =
"0" + vs;
57 for (
int j = 0; j != 100; ++j)
96 for (
unsigned int i = 0; i < 100; ++i) {
98 if (vs.size() == 1) vs =
"0" + vs;
104 mset = enquire.
get_mset(0, 10, 0, NULL, &md);
139 while (begin != end) {
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
Base class for backend handling in test harness.
Xapian::Database get_database(const std::vector< std::string > &files)
Get a database instance of the current type.
void indexing_begin(const std::string &dbname, const std::map< std::string, std::string > ¶ms)
Log the start of an indexing run.
void testcase_end()
End a testcase.
void search_end(const Xapian::Query &query, const Xapian::MSet &mset)
Log the completion of a search.
void searching_end()
Log the end of a search run.
void search_start()
Log the start of a search.
void indexing_end()
Log the end of an indexing run.
void searching_start(const std::string &description)
Log the start of a search run.
void testcase_begin(const std::string &testcase)
Start a testcase.
void indexing_add()
Log the addition of a document in an indexing run.
An indexed database of documents.
PostingIterator postlist_begin(std::string_view term) const
Start iterating the postings of a term.
Xapian::doccount get_doccount() const
Get the number of documents in the database.
PostingIterator postlist_end(std::string_view) const noexcept
End iterator corresponding to postlist_begin().
Class representing a document.
void set_data(std::string_view data)
Set the document data.
void add_term(std::string_view term, Xapian::termcount wdf_inc=1)
Add a term to this document.
void add_value(Xapian::valueno slot, std::string_view value)
Add a value to a slot in this document.
MSet get_mset(doccount first, doccount maxitems, doccount checkatleast=0, const RSet *rset=NULL, const MatchDecider *mdecider=NULL) const
Run the query.
void set_query(const Query &query, termcount query_length=0)
Set the query.
Class representing a list of search results.
Xapian::doccount size() const
Return number of items in this MSet object.
Xapian::doccount get_matches_upper_bound() const
Upper bound on the total number of matching documents.
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
Class for iterating over a list of terms.
Class representing a query.
@ OP_FILTER
Match like OP_AND but only taking weight from the first subquery.
@ OP_VALUE_LE
Match only documents where a value slot is <= a given value.
MatchDecider filtering results based on whether document values are in a user-defined set.
void add_value(const std::string &value)
Add a value to the test set.
This class provides read/write access to a database.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a document in the database.
void commit()
Commit pending modifications.
string str(int value)
Convert int to std::string.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
performance tests for Xapian.
static void builddb_valuestest1(Xapian::WritableDatabase &db, const string &dbname)
DEFINE_TESTCASE(valuesetmatchdecider1, writable &&!remote &&!inmemory)
Convert types to std::string.
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
BackendManager * backendmanager
backendmanager is global so that it can be accessed by individual tests.
Run multiple tests for different backends.
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.
void test_mset_order_equal(const Xapian::MSet &mset1, const Xapian::MSet &mset2)
Xapian-specific test helper functions and macros.
Public interfaces for the Xapian library.