42 static const char *
const vals[] = {
43 "",
" ",
"a",
"aa",
"abcd",
"e",
"g",
"h",
"hzz",
"i",
"l",
"z"
45 for (
auto start : vals) {
46 for (
auto end : vals) {
51 set<Xapian::docid> matched;
53 for (i = mset.
begin(); i != mset.
end(); ++i) {
61 if (matched.find(j) == matched.end()) {
63 tout << value <<
" < '" << start <<
"' or > '" << end <<
"'\n";
64 TEST(value < start || value > end);
290 static const char *
const vals[] = {
291 "",
" ",
"a",
"aa",
"abcd",
"e",
"g",
"h",
"hzz",
"i",
"l",
"z"
293 for (
auto start : vals) {
298 set<Xapian::docid> matched;
300 for (i = mset.
begin(); i != mset.
end(); ++i) {
303 tout <<
"'" << start <<
"' <= '" << value <<
"'\n";
309 if (matched.find(j) == matched.end()) {
311 tout << value <<
" < '" << start <<
"'\n";
334 static const char *
const vals[] = {
335 "",
" ",
"a",
"aa",
"abcd",
"e",
"g",
"h",
"hzz",
"i",
"l",
"z"
337 for (
auto end : vals) {
342 set<Xapian::docid> matched;
344 for (i = mset.
begin(); i != mset.
end(); ++i) {
352 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
This class is used to access a database, or a group of databases.
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::Document get_document(Xapian::docid did) const
Get a document from the database, given its document id.
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.
A handle representing a document in a Xapian database.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
std::string get_value(Xapian::valueno slot) const
Get value by number.
void set_data(const std::string &data)
Set data stored in the document.
This class provides an interface to the information retrieval system for the purpose of searching.
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
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.
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 given document in the database.
Xapian::docid add_document(const Xapian::Document &document)
Add a new 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.