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);
114 enq.set_query(query);
119 enq.set_query(query2);
120 mset = enq.get_mset(0, 0);
163 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"PEACH",
"PEACHERINE");
170 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SING",
"SINGULARITY");
177 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SING",
"SINGULAR");
184 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SINGULAR",
"SINGULARITY");
191 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SINGULAR",
"SINGULAR");
198 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SINGULARITY",
"SINGULARITY");
205 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SINGULARITY",
"SINGULARITIES");
212 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SINGULARITY",
"SINNER");
219 query =
Xapian::Query(OP_VALUE_RANGE, 0,
"SINGULARITY",
"ZEBRA");
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 void make_singularvalue_db(Xapian::WritableDatabase &db, const string &)
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 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.
static const Xapian::Query MatchAll
A query matching all documents.
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
Xapian::docid get_lastdocid() const
Get the highest document id which has been used in the database.
a generic test suite engine
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.
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.
test functionality of the Xapian API
DEFINE_TESTCASE(valuerange1, backend)
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);.
This class provides read/write access to a database.
std::ostringstream tout
The debug printing stream.
Iterator over a Xapian::MSet.
Public interfaces for the Xapian library.
Match only documents where a value slot is >= a given value.
Match only documents where a value slot is within a given range.
MSetIterator begin() const
Return iterator pointing to the first item in this MSet.
MSetIterator end() const
Return iterator pointing to just after the last item in this MSet.
Match only documents where a value slot is <= a given value.
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
size_t size() const
Return number of shards in this Database object.
Match only documents which all subqueries match.
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())
Xapian::Database get_database(const string &dbname)
Xapian::doccount get_matches_estimated() const
Estimate of the total number of matching documents.
std::string get_description() const
Return a string describing this object.
This class provides an interface to the information retrieval system for the purpose of searching...
std::string get_value_lower_bound(Xapian::valueno slot) const
Get a lower bound on the values stored in the given value slot.
Xapian-specific test helper functions and macros.
#define TEST_STRINGS_EQUAL(a, b)
Test for equality of two strings.
static void make_valuerange5(Xapian::WritableDatabase &db, const string &)
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.
static void make_valprefixbounds_db(Xapian::WritableDatabase &db, const string &)
void set_data(const std::string &data)
Set data stored in the document.
std::string get_value(Xapian::valueno slot) const
Get value by number.
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.