41 static const char *
const vals[] = {
42 "",
" ",
"a",
"aa",
"abcd",
"e",
"g",
"h",
"hzz",
"i",
"l",
"z"
44 for (
auto start : vals) {
45 for (
auto end : vals) {
50 set<Xapian::docid> matched;
52 for (i = mset.
begin(); i != mset.
end(); ++i) {
60 if (matched.find(j) == matched.end()) {
62 tout << value <<
" < '" << start <<
"' or > '" << end <<
"'\n";
63 TEST(value < start || value > end);
289 static const char *
const vals[] = {
290 "",
" ",
"a",
"aa",
"abcd",
"e",
"g",
"h",
"hzz",
"i",
"l",
"z"
292 for (
auto start : vals) {
297 set<Xapian::docid> matched;
299 for (i = mset.
begin(); i != mset.
end(); ++i) {
302 tout <<
"'" << start <<
"' <= '" << value <<
"'\n";
308 if (matched.find(j) == matched.end()) {
310 tout << value <<
" < '" << start <<
"'\n";
333 static const char *
const vals[] = {
334 "",
" ",
"a",
"aa",
"abcd",
"e",
"g",
"h",
"hzz",
"i",
"l",
"z"
336 for (
auto end : vals) {
341 set<Xapian::docid> matched;
343 for (i = mset.
begin(); i != mset.
end(); ++i) {
351 if (matched.find(j) == matched.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())
static void make_singularvalue_db(Xapian::WritableDatabase &db, const string &)
static void make_valuerange5(Xapian::WritableDatabase &db, const string &)
static void make_valprefixbounds_db(Xapian::WritableDatabase &db, const string &)
DEFINE_TESTCASE(valuerange1, backend)
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_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::docid get_lastdocid() const
Get the highest document id which has been used in the database.
Xapian::doccount get_value_freq(Xapian::valueno slot) const
Return the frequency of a given value slot.
Xapian::Document get_document(Xapian::docid did, unsigned flags=0) const
Get a document from the database.
Class representing a document.
void set_data(std::string_view data)
Set the document data.
std::string get_value(Xapian::valueno slot) const
Read a value slot in 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.
Iterator over a Xapian::MSet.
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.
MSetIterator begin() const
Return iterator pointing to the first item in this MSet.
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
MSetIterator end() const
Return iterator pointing to just after the last item in this MSet.
Xapian::doccount get_matches_estimated() const
Estimate of the total number of matching documents.
Class representing a query.
std::string get_description() const
Return a string describing this object.
@ OP_VALUE_RANGE
Match only documents where a value slot is within a given range.
@ OP_AND
Match only documents which all subqueries match.
@ OP_VALUE_LE
Match only documents where a value slot is <= a given value.
@ OP_VALUE_GE
Match only documents where a value slot is >= a given value.
static const Xapian::Query MatchAll
A query matching all documents.
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.
Xapian::docid add_document(const Xapian::Document &doc)
Add a document to the database.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
std::ostringstream tout
The debug printing stream.
a generic test suite engine
#define TEST_EQUAL(a, b)
Test for equality of two things.
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
#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.