33 #define XAPIAN_DEPRECATED(X) X 48 for ( ; i != mset.
end(); ++i) {
57 for ( ; i != mset.
end(); ++i) {
64 const string & t1 =
string(),
const string & t2 =
string(),
65 const string & t3 =
string(),
const string & t4 =
string(),
66 const string & t5 =
string(),
const string & t6 =
string(),
67 const string & t7 =
string(),
const string & t8 =
string(),
68 const string & t9 =
string(),
const string & t10 =
string())
72 if (!t1.empty()) v.push_back(stemmer(t1));
73 if (!t2.empty()) v.push_back(stemmer(t2));
74 if (!t3.empty()) v.push_back(stemmer(t3));
75 if (!t4.empty()) v.push_back(stemmer(t4));
76 if (!t5.empty()) v.push_back(stemmer(t5));
77 if (!t6.empty()) v.push_back(stemmer(t6));
78 if (!t7.empty()) v.push_back(stemmer(t7));
79 if (!t8.empty()) v.push_back(stemmer(t8));
80 if (!t9.empty()) v.push_back(stemmer(t9));
81 if (!t10.empty()) v.push_back(stemmer(t10));
87 const string & t1 =
string(),
const string & t2 =
string(),
88 const string & t3 =
string(),
const string & t4 =
string(),
89 const string & t5 =
string(),
const string & t6 =
string(),
90 const string & t7 =
string(),
const string & t8 =
string(),
91 const string & t9 =
string(),
const string & t10 =
string())
95 if (!t1.empty()) v.push_back(stemmer(t1));
96 if (!t2.empty()) v.push_back(stemmer(t2));
97 if (!t3.empty()) v.push_back(stemmer(t3));
98 if (!t4.empty()) v.push_back(stemmer(t4));
99 if (!t5.empty()) v.push_back(stemmer(t5));
100 if (!t6.empty()) v.push_back(stemmer(t6));
101 if (!t7.empty()) v.push_back(stemmer(t7));
102 if (!t8.empty()) v.push_back(stemmer(t8));
103 if (!t9.empty()) v.push_back(stemmer(t9));
104 if (!t10.empty()) v.push_back(stemmer(t10));
137 "A query on a database returned a zero docid");
154 vector<Xapian::Query> v;
329 TEST_REL(eset[36].get_weight(), <, 0);
330 TEST_REL(eset[36].get_weight(), >=, -100);
426 tout <<
"mymset.size() = " << mymset.
size() <<
'\n';
431 myrset.add_document(*i);
432 myrset.add_document(*(++i));
469 TEST_EQUAL(mymset1[5].get_document().get_data(),
470 mymset2[2].get_document().get_data());
481 for ( ; i != mymset.
end(); ++i) {
484 "convert_to_%(msetitor) != convert_to_%(wt)");
486 "convert_to_%(msetitor) != convert_to_%(wt)");
488 "percentage out of range: " << pct);
518 "this",
"line",
"paragraph",
"rubbish");
546 unsigned long sum = 0;
547 for (
unsigned ch : tname) {
553 return (sum % 2) == 0;
567 myrset.add_document(*i);
568 myrset.add_document(*(++i));
573 unsigned int neweset_size = 0;
575 for ( ; j != myeset_orig.
end(); ++j) {
576 if (myfunctor(*j)) neweset_size++;
583 tout <<
"orig_eset: ";
584 copy(myeset_orig.
begin(), myeset_orig.
end(),
585 ostream_iterator<Xapian::ESetItem>(
tout,
" "));
588 tout <<
"new_eset: ";
590 ostream_iterator<Xapian::ESetItem>(
tout,
" "));
596 for (; orig != myeset_orig.
end() && filt != myeset.
end(); ++orig, ++filt) {
598 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
604 "Mismatch in items " << *orig <<
" vs. " << *filt
605 <<
" after filtering");
608 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
614 "Extra items in the filtered eset.");
626 myrset.add_document(*i);
627 myrset.add_document(*(++i));
630 unsigned int neweset_size = 0;
635 string prefix(*j, 0, 1);
638 for ( ; j != myeset_orig.
end(); ++j) {
639 if (myfunctor(*j)) neweset_size++;
645 for (; orig != myeset_orig.
end() && filt != myeset.
end(); ++orig, ++filt) {
647 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
653 "Mismatch in items " << *orig <<
" vs. " << *filt
654 <<
" after filtering");
657 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
663 "Extra items in the filtered eset.");
670 "this",
"line",
"paragraph",
"rubbish"));
674 tout <<
"Original mset pcts:";
679 unsigned int num_items = 0;
684 for ( ; i != mymset1.
end(); ++i, ++c) {
686 if (new_pct != my_pct) {
688 if (changes > 3)
break;
696 tout <<
"Cutoff percent: " << my_pct <<
"\n";
703 tout <<
"Percentages after cutoff:";
709 "Match with % cutoff lost too many items");
714 "Match with % cutoff returned too many items");
724 tout <<
"Original mset pcts:";
730 TEST(mset[0].get_percent() - mset[1].get_percent() >= 2);
732 int cutoff = mset[0].get_percent() + mset[1].get_percent();
756 tout <<
"Original mset pcts:";
764 if (new_percent != percent) {
766 tout <<
"Testing " << percent <<
"% cutoff\n";
771 percent = new_percent;
780 "this",
"line",
"paragraph",
"rubbish"));
784 tout <<
"Original mset weights:";
789 unsigned int num_items = 0;
794 for ( ; i != mymset1.
end(); ++i, ++c) {
796 if (new_wt != my_wt) {
798 if (changes > 3)
break;
806 tout <<
"Cutoff weight: " << my_wt <<
"\n";
813 tout <<
"Weights after cutoff:";
819 "Match with cutoff lost too many items");
822 (mymset2[num_items].get_weight() == my_wt &&
824 "Match with cutoff returned too many items");
830 string term =
"paragraph";
838 myrset.add_document(*i);
839 myrset.add_document(*(++i));
843 for ( ; j != myeset.
end(); ++j) {
849 for ( ; j != myeset2.
end(); ++j) {
850 if (*j == term)
break;
863 for ( ; i != mymset.
end(); ++i) {
877 "Mset was too small to test properly");
890 for ( ; i != mymset1.
end(); ++i, j++) {
905 for ( ; i != mymset1.
end(); ++i) {
923 "Mset was too small to test properly");
936 for ( ; j != mymset2.
end(); ++i, ++j) {
951 for (j = mymset3.
begin(); j != mymset3.
end(); ++j) {
962 list<string> answers_list;
963 answers_list.push_back(
"one");
964 answers_list.push_back(
"two");
965 answers_list.push_back(
"three");
966 answers_list.push_back(
"four");
986 TEST(list == answers_list);
991 list<string> answers_list;
992 answers_list.push_back(
"one");
993 answers_list.push_back(
"two");
994 answers_list.push_back(
"three");
1014 TEST(list == answers_list);
1039 mymset2.
fetch(mymset2[0], mymset2[mymset2.
size() - 1]);
1047 while (it1 != mymset1.
end() && it2 != mymset2.
end()) {
1072 vector<string> terms;
1073 terms.push_back(
"frink");
1110 for (
int i = 0; i < 2; ++i) {
1225 vector<Xapian::Query> qs;
1226 qs.push_back(
query(
"this"));
1229 qs.begin(), qs.end(), 1);
1247 vector<Xapian::Query> qs;
1248 qs.push_back(
query(
"this"));
1251 qs.begin(), qs.end(), 1);
1287 string term1 =
stemmer(
"word");
1288 string term2 =
stemmer(
"rubbish");
1289 string term3 =
stemmer(
"banana");
1291 vector<string> terms;
1292 terms.push_back(term1);
1293 terms.push_back(term2);
1294 terms.push_back(term3);
1332 "word",
"rubbish",
"fibble");
1350 "word",
"rubbish",
"fibble");
1379 for (
int i = 0; i != 3; ++i) {
1380 v.push_back(
"simpl");
1381 v.push_back(
"queri");
1383 v.push_back(
"rubbish");
1384 v.push_back(
"rubbish");
1385 v.push_back(
"rubbish");
1386 v.push_back(
"word");
1387 v.push_back(
"word");
1388 v.push_back(
"word");
1393 v.begin(), v.end(), n);
1419 string theterm =
stemmer(
"another");
1425 for ( ; i != eset1.
end(); ++i) {
1426 if (*i == theterm) {
1434 for ( ; i != eset2.
end(); ++i) {
1435 if (*i == theterm) {
1459 string term1 =
stemmer(
"word");
1460 string term2 =
stemmer(
"inmemory");
1461 string term3 =
stemmer(
"flibble");
1471 for (
int i = 1; i <= 2; ++i) {
1515 string term1 =
stemmer(
"paragraph");
1516 string term2 =
stemmer(
"another");
1548 bool remote =
get_dbtype().find(
"remote") != string::npos;
1555 myquery =
query(
"word");
1598 if (db.
size() == 1) {
1612 TEST_EQUAL(mymset.get_matches_lower_bound(), 2);
1613 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1614 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1615 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 2);
1616 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1617 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1620 TEST_EQUAL(mymset.get_matches_lower_bound(), 2);
1621 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1622 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1623 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 2);
1624 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1625 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1630 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1631 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1632 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1633 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1634 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1635 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1638 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1639 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1640 if (db.
size() > 1 && remote) {
1642 TEST_EQUAL(mymset.get_matches_estimated(), 1);
1643 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 1);
1644 TEST_EQUAL(mymset.get_matches_upper_bound(), 1);
1645 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 1);
1647 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1648 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1649 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1650 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1654 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1655 TEST_EQUAL(mymset.get_matches_estimated(), 1);
1656 TEST_EQUAL(mymset.get_matches_upper_bound(), 1);
1657 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1658 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 1);
1659 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 1);
1662 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1663 TEST_EQUAL(mymset.get_matches_estimated(), 1);
1664 TEST_EQUAL(mymset.get_matches_upper_bound(), 1);
1665 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1666 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 1);
1667 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 1);
1726 vector<string> v(t, tend);
1730 vector<string>::const_iterator i;
1731 for (i = v.begin(); i != v.end(); ++i) {
1798 for (m = mymset.
begin(); m != mymset.
end(); ++m) ++count;
1810 for (m = mymset.
begin(); m != mymset.
end(); ++m) ++count;
1816 if (value_no == 0) {
1817 TEST(value.size() > 262);
1818 TEST_EQUAL(static_cast<unsigned char>(value[262]), 255);
1826 for (m = mymset.
begin(); m != mymset.
end(); ++m) ++count;
1835 vector<string> terms;
1836 terms.push_back(
stemmer(
"this"));
1837 terms.push_back(
stemmer(
"word"));
1838 terms.push_back(
stemmer(
"of"));
1860 vector<string> terms;
1861 terms.push_back(
stemmer(
"this"));
1862 terms.push_back(
stemmer(
"word"));
1863 terms.push_back(
stemmer(
"of"));
1899 vector<Xapian::Query> nullvec;
1932 mymset = enquire.
get_mset(0, 2, 4);
1934 TEST_REL(mymset.get_matches_lower_bound(),>=,4);
1935 TEST_REL(mymset.get_matches_lower_bound(),>=,4);
1936 TEST_REL(mymset.get_uncollapsed_matches_lower_bound(),>=,4);
1937 TEST_REL(mymset.get_uncollapsed_matches_lower_bound(),>=,4);
1945 for (
int order = 0; order < 3; ++order) {
1958 for (
int sort = 0; sort < 7; ++sort) {
1959 bool reverse = (sort & 1);
1984 mset = enquire.
get_mset(0, 50, 100);
1986 TEST_EQUAL(mset.get_matches_lower_bound(), 60);
1987 TEST_EQUAL(mset.get_matches_estimated(), 60);
1988 TEST_EQUAL(mset.get_matches_upper_bound(), 60);
1989 TEST_EQUAL(mset.get_uncollapsed_matches_lower_bound(), 60);
1990 TEST_EQUAL(mset.get_uncollapsed_matches_estimated(), 60);
1991 TEST_EQUAL(mset.get_uncollapsed_matches_upper_bound(), 60);
1993 mset = enquire.
get_mset(0, 10, 50);
1995 TEST_REL(mset.get_matches_lower_bound(),>=,50);
1996 TEST_REL(mset.get_uncollapsed_matches_lower_bound(),>=,50);
2164 static const char *
const queries[] = {
2167 "leave milk on fridge",
2168 "ordered milk operator",
2169 "ordered phrase operator",
2170 "leave \"milk on fridge\"",
2172 "leave \"milk notpresent\"",
2174 static const double multipliers[] = {
2175 -1000000, -2.5, -1, -0.5, 0, 0.5, 1, 2.5, 1000000,
2179 for (
auto qstr : queries) {
2183 for (
const double *multp = multipliers; multp[0] != multp[1]; ++multp) {
2184 double mult = *multp;
2204 i1 != mset1.
end() && i2 != mset2.
end(); ++i1, ++i2) {
2210 vector<Xapian::docid> ids1;
2211 vector<Xapian::docid> ids2;
2213 i1 != mset1.
end() && i2 != mset2.
end(); ++i1, ++i2) {
2216 ids1.push_back(*i1);
2217 ids2.push_back(*i2);
2219 sort(ids1.begin(), ids1.end());
2246 vector<Xapian::docid> ids1;
2247 set<Xapian::docid> idsin1;
2248 vector<Xapian::docid> ids3;
2255 for (i = mset1.
begin(); i != mset1.
end(); ++i) {
2260 for (i = mset3.
begin(); i != mset3.
end(); ++i) {
2261 if (idsin1.find(*i) != idsin1.end())
2265 sort(ids3.begin(), ids3.end());
2266 ids1.insert(ids1.end(), ids3.begin(), ids3.end());
2269 vector<Xapian::docid> ids5;
2272 for (i = mset5.
begin(); i != mset5.
end(); ++i) {
2288 TEST(db2.get_uuid().empty());
2290 db2.add_database(db);
2295 db2.add_database(db);
2296 TEST_EQUAL(uuid1 +
":" + uuid1, db2.get_uuid());
2298 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 2302 TEST(db2.get_uuid().empty());
#define TEST_MSET_SIZE(M, S)
Check MSet M has size S.
const int DB_BACKEND_INMEMORY
Use the "in memory" backend.
ExpandDecider subclass which restrict terms to a particular prefix.
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.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
void set_expansion_scheme(const std::string &eweightname_, double expand_k_=1.0) const
Set the weighting scheme to use for expansion.
void set_sort_by_value_then_relevance(Xapian::valueno sort_key, bool reverse)
Set the sorting to be by value, then by relevance for documents with the same value.
TermIterator termlist_begin(Xapian::docid did) const
An iterator pointing to the start of the termlist for a given document.
double get_max_possible() const
The maximum possible weight any document could achieve.
void set_sort_by_relevance()
Set the sorting to be by relevance only.
void set_docid_order(docid_order order)
Set sort order for document IDs.
#define TEST(a)
Test a condition, without an additional explanation for failure.
static void print_mset_percentages(const Xapian::MSet &mset)
int convert_to_percent(double weight) const
Convert a weight to a percentage.
This class is used to access a database, or a group of databases.
void set_sort_by_value(Xapian::valueno sort_key, bool reverse)
Set the sorting to be by value only.
ESetIterator back() const
Return iterator pointing to the last object in this ESet.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
TermIterator get_matching_terms_end(Xapian::docid) const
End iterator corresponding to get_matching_terms_begin()
Match documents which an odd number of subqueries match.
void set_cutoff(int percent_cutoff, double weight_cutoff=0)
Set the percentage and/or weight cutoffs.
Class representing a stemming algorithm.
PositionIterator positionlist_begin(Xapian::docid did, const std::string &tname) const
An iterator pointing to the start of the position list for a given term in a given document...
bool mset_range_is_same(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)
#define TEST_AND_EXPLAIN(a, b)
Test a condition, and display the test with an extra explanation if the condition fails...
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
static void test_emptyterm1_helper(Xapian::Database &db)
#define TEST_NOT_EQUAL_DOUBLE(a, b)
Test two doubles for non-near-equality.
Xapian::WritableDatabase get_writable_database(const string &dbname)
double get_max_attained() const
The maximum weight attained by any document.
Build a Xapian::Query object from a user query string.
a generic test suite engine
static const int USE_EXACT_TERMFREQ
Calculate exact term frequencies in get_eset().
Class representing a list of search results.
void skip_to(const std::string &term)
Advance the iterator to term term.
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.
Virtual base class for expand decider functor.
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.
static Xapian::Stem stemmer
static const int INCLUDE_QUERY_TERMS
Terms in the query may be returned by get_eset().
double get_weight() const
Get the weight for the current position.
TermIterator get_matching_terms_begin(Xapian::docid did) const
Get terms which match a given document, by document id.
test functionality of the Xapian API
Xapian::doccount get_matches_upper_bound() const
Upper bound on the total number of matching documents.
Class for iterating over a list of terms.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
#define TEST_REL(A, REL, B)
Test a relation holds,e.g. TEST_REL(a,>,b);.
ESetIterator begin() const
Return iterator pointing to the first item in this ESet.
Class for iterating over a list of terms.
ESet get_eset(Xapian::termcount maxitems, const RSet &omrset, int flags=0, const Xapian::ExpandDecider *edecider=0, double min_wt=0.0) const
Get the expand set for the given rset.
#define TEST_NOT_EQUAL(a, b)
Test for non-equality of two things.
Xapian::doccount size() const
Return number of items in this ESet object.
Xapian::doccount get_uncollapsed_matches_estimated() const
Estimate of the total number of matching documents before collapsing.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
Class implementing a "boolean" weighting scheme.
docids sort in whatever order is most efficient for the backend.
Pick the best N subqueries and combine with OP_OR.
This class provides read/write access to a database.
DEFINE_TESTCASE(zerodocid1, backend)
std::ostringstream tout
The debug printing stream.
Iterator over a Xapian::MSet.
Scale the weight contributed by a subquery.
bool operator()(const string &tname) const override
Do we want this term in the ESet?
Public interfaces for the Xapian library.
void set_sort_by_relevance_then_value(Xapian::valueno sort_key, bool reverse)
Set the sorting to be by relevance then value.
docids sort in ascending order (default)
void delete_document(Xapian::docid did)
Delete a document from the database.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
void fetch(const MSetIterator &begin, const MSetIterator &end) const
Prefetch hint a range of items.
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.
Xapian::termcount get_ebound() const
Return a bound on the full size of this ESet object.
double get_termweight(const std::string &term) const
Get the term weight of a term.
int percent
The percentage score for a document in an MSet.
void commit()
Commit any pending modifications made to the database.
Xapian::Weight subclass implementing the traditional probabilistic formula.
static void print_mset_weights(const Xapian::MSet &mset)
Query parse_query(const std::string &query_string, unsigned flags=FLAG_DEFAULT, const std::string &default_prefix=std::string())
Parse a query.
int get_percent() const
Convert the weight of the current iterator position to a percentage.
Iterator over a Xapian::ESet.
TermIterator termlist_end(Xapian::docid) const
Corresponding end iterator to termlist_begin().
#define TEST_EQUAL_DOUBLE(a, b)
Test two doubles for near equality.
#define SKIP_TEST_FOR_BACKEND(B)
void add_database(const Database &database)
Add an existing database (or group of databases) to those accessed by this object.
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
Indicates an attempt to access a document not present in the database.
size_t size() const
Return number of shards in this Database object.
bool term_exists(const std::string &tname) const
Check if a given term exists in the database.
double get_weight() const
Get the weight for the current position.
void add_document(Xapian::docid did)
Add a document to the relevance set.
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.
static Xapian::TermIterator test_termlist3_helper()
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.
Xapian::termcount get_doclength() const
Return the length of the document at the current position.
Xapian::doccount get_uncollapsed_matches_upper_bound() const
Upper bound on the total number of matching documents before collapsing.
Match documents which the first subquery matches but no others do.
Match documents which at least one subquery matches.
void skip_to(Xapian::docid did)
Advance the iterator to document did.
unsigned valueno
The number for a value slot in a document.
Xapian-specific test helper functions and macros.
bool mset_range_is_same_weights(const Xapian::MSet &mset1, unsigned int first1, const Xapian::MSet &mset2, unsigned int first2, unsigned int count)
Xapian::doccount get_termfreq(const std::string &term) const
Get the termfreq of a term.
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)
Class representing a list of search results.
Xapian::Document get_document() const
Get the Document object for the current position.
void set_weighting_scheme(const Weight &weight_)
Set the weighting scheme to use for queries.
Class representing a query.
std::string get_data() const
Get data stored in the document.
#define TEST_EQUAL(a, b)
Test for equality of two things.
PostingIterator postlist_end(const std::string &) const
Corresponding end iterator to postlist_begin().
MSetIterator back() const
Return iterator pointing to the last object in this MSet.
void set_data(const std::string &data)
Set data stored in the document.
void set_collapse_key(Xapian::valueno collapse_key, Xapian::doccount collapse_max=1)
Set the collapse key to use for queries.
std::string get_value(Xapian::valueno slot) const
Get value by number.
ESetIterator end() const
Return iterator pointing to just after the last item in this ESet.
Xapian::doccount get_termfreq(const std::string &tname) const
Get the number of documents in the database indexed by a given term.
A handle representing a document in a Xapian database.
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
std::string get_uuid() const
Get a UUID for the database.
PostingIterator postlist_begin(const std::string &tname) const
An iterator pointing to the start of the postlist for a given term.
Xapian::doccount get_uncollapsed_matches_lower_bound() const
Lower bound on the total number of matching documents before collapsing.
Xapian::termcount get_collection_freq(const std::string &tname) const
Return the total number of occurrences of the given term.
docids sort in descending order.