41 tout <<
"testing valuestream iteration for slot " << slot << endl;
61 unsigned interval = 1;
62 while (interval < 1999) {
64 tout <<
"testing valuestream skip_to for slot " << slot
65 <<
" with interval " << interval << endl;
76 while (did < actual_did) {
86 interval = interval * 3 - 1;
97 CHECK, CHECK_AND_NEXT, CHECK2, SKIP_TO, CHECK_AND_LOOP
99 test_op operation = CHECK;
102 unsigned interval = 1;
103 while (interval < 1999) {
104 tout <<
"testing valuestream check for slot " << slot
105 <<
" with interval " << interval << endl;
110 bool positioned =
true;
115 case CHECK:
case CHECK2:
116 positioned = it.
check(did);
118 case CHECK_AND_NEXT: {
119 bool was_skip_to = it.
check(did);
120 if (!was_skip_to) ++it;
127 operation = test_op(operation + 1);
135 while (did < actual_did) {
146 interval = interval * 3 - 1;
Xapian::doccount size() const
Return number of items in this MSet object.
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 skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
#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.
bool mset_range_is_same(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)
Xapian::docid get_docid() const
Return the current docid.
A posting source which looks up weights in a map using values as the key.
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
Xapian::WritableDatabase get_writable_database(const string &dbname)
bool at_end() const
Return true if the current position is past the last entry in this list.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
a generic test suite engine
Class for iterating over document values.
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.
std::string sortable_serialise(double value)
Convert a floating point number to a string, preserving sort order.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
void clear_mappings()
Clear all mappings.
Read weights from a value which is known to decrease as docid increases.
test functionality of the Xapian API
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
ValueIterator valuestream_end(Xapian::valueno) const
Return end iterator corresponding to valuestream_begin().
This class provides read/write access to a database.
std::ostringstream tout
The debug printing stream.
Public interfaces for the Xapian library.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
A posting source which returns a fixed weight for all documents.
bool at_end() const
Return true if the current position is past the last entry in this list.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void commit()
Commit any pending modifications made to the database.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
#define SKIP_TEST_FOR_BACKEND(B)
ValueIterator valuestream_begin(Xapian::valueno slot) const
Return an iterator over the value in slot slot for each document.
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
bool check(Xapian::docid docid)
Check if the specified docid occurs.
A posting source which reads weights from a value slot.
Xapian::Database get_database(const string &dbname)
void set_default_weight(double wt)
Set a default weight for document values not in the map.
This class provides an interface to the information retrieval system for the purpose of searching...
void init(const Xapian::Database &db_)
Set this PostingSource to the start of the list of postings.
void add_mapping(const std::string &key, double wt)
Add a mapping.
unsigned valueno
The number for a value slot in a document.
Xapian-specific test helper functions and macros.
Xapian::docid get_docid() const
Return the docid at the current position.
void mset_expect_order(const Xapian::MSet &A, Xapian::docid d1, Xapian::docid d2, Xapian::docid d3, Xapian::docid d4, Xapian::docid d5, Xapian::docid d6, Xapian::docid d7, Xapian::docid d8, Xapian::docid d9, Xapian::docid d10, Xapian::docid d11, Xapian::docid d12)
void next(double min_wt)
Advance the current position to the next matching document.
void next(double min_wt)
Advance the current position to the next matching document.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Class representing a query.
#define TEST_EQUAL(a, b)
Test for equality of two things.
std::string get_value(Xapian::valueno slot) const
Get value by number.
A handle representing a document in a Xapian database.
Xapian::valueno get_valueno() const
Return the value slot number for the current position.
DEFINE_TESTCASE(valuestream1, backend &&!multi)
Feature test simple valuestream iteration.
void skip_to(Xapian::docid docid_or_slot)
Advance the iterator to document id or value slot docid_or_slot.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.
void next(double min_wt)
Advance the current position to the next matching document.