42 unsigned int runsize = 1000000;
45 std::map<std::string, std::string> params;
46 params[
"runsize"] =
str(runsize);
48 for (
unsigned int i = 0; i < runsize; ++i) {
49 unsigned int v = i % 100;
54 if (vs.size() == 1) vs =
"0" + vs;
58 for (
int j = 0; j != 100; ++j)
97 for (
unsigned int i = 0; i < 100; ++i) {
99 if (vs.size() == 1) vs =
"0" + vs;
105 mset = enquire.
get_mset(0, 10, 0, NULL, &md);
140 while (begin != end) {
Xapian::doccount size() const
Return number of items in this MSet object.
Run multiple tests for different backends.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
MatchDecider filtering results based on whether document values are in a user-defined set...
#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.
Xapian::Database get_database(const std::vector< std::string > &files)
Get a database instance of the current type.
void searching_start(const std::string &description)
Log the start of a search run.
void search_start()
Log the start of a search.
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
performance tests for Xapian.
void indexing_add()
Log the addition of a document in an indexing run.
a generic test suite engine
void add_value(const std::string &value)
Add a value to the test set.
Class representing a list of search results.
MSet get_mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount checkatleast=0, const RSet *omrset=0, const MatchDecider *mdecider=0) const
Get (a portion of) the match set for the current query.
Convert types to std::string.
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 testcase_begin(const std::string &testcase)
Start a testcase.
Xapian::doccount get_matches_upper_bound() const
Upper bound on the total number of matching documents.
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
Class for iterating over a list of terms.
Base class for backend handling in test harness.
void test_mset_order_equal(const Xapian::MSet &mset1, const Xapian::MSet &mset2)
This class provides read/write access to a database.
Public interfaces for the Xapian library.
Match like OP_AND but only taking weight from the first subquery.
BackendManager * backendmanager
backendmanager is global so that it can be accessed by individual tests.
string str(int value)
Convert int to std::string.
Match only documents where a value slot is <= a given value.
void commit()
Commit any pending modifications made to the database.
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
void indexing_end()
Log the end of an indexing run.
static void builddb_valuestest1(Xapian::WritableDatabase &db, const string &dbname)
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())
DEFINE_TESTCASE(valuesetmatchdecider1, writable &&!remote &&!inmemory)
This class provides an interface to the information retrieval system for the purpose of searching...
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
void search_end(const Xapian::Query &query, const Xapian::MSet &mset)
Log the completion of a search.
Xapian-specific test helper functions and macros.
void searching_end()
Log the end of a search run.
void testcase_end()
End a testcase.
Class representing a query.
#define TEST_EQUAL(a, b)
Test for equality of two things.
PostingIterator postlist_end(const std::string &) const
Corresponding end iterator to postlist_begin().
void set_data(const std::string &data)
Set data stored in the document.
A handle representing a document in a Xapian database.
PostingIterator postlist_begin(const std::string &tname) const
An iterator pointing to the start of the postlist for a given term.
void indexing_begin(const std::string &dbname, const std::map< std::string, std::string > ¶ms)
Log the start of an indexing run.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.