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);
416 tout <<
"mymset.size() = " << mymset.
size() <<
'\n';
421 myrset.add_document(*i);
422 myrset.add_document(*(++i));
459 TEST_EQUAL(mymset1[5].get_document().get_data(),
460 mymset2[2].get_document().get_data());
471 for ( ; i != mymset.
end(); ++i) {
474 "convert_to_%(msetitor) != convert_to_%(wt)");
476 "convert_to_%(msetitor) != convert_to_%(wt)");
478 "percentage out of range: " << pct);
508 "this",
"line",
"paragraph",
"rubbish");
536 unsigned long sum = 0;
537 for (
unsigned ch : tname) {
543 return (sum % 2) == 0;
557 myrset.add_document(*i);
558 myrset.add_document(*(++i));
563 unsigned int neweset_size = 0;
565 for ( ; j != myeset_orig.
end(); ++j) {
566 if (myfunctor(*j)) neweset_size++;
573 tout <<
"orig_eset: ";
574 copy(myeset_orig.
begin(), myeset_orig.
end(),
575 ostream_iterator<Xapian::ESetItem>(
tout,
" "));
578 tout <<
"new_eset: ";
580 ostream_iterator<Xapian::ESetItem>(
tout,
" "));
586 for (; orig != myeset_orig.
end() && filt != myeset.
end(); ++orig, ++filt) {
588 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
594 "Mismatch in items " << *orig <<
" vs. " << *filt
595 <<
" after filtering");
598 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
604 "Extra items in the filtered eset.");
616 myrset.add_document(*i);
617 myrset.add_document(*(++i));
620 unsigned int neweset_size = 0;
625 string prefix(*j, 0, 1);
628 for ( ; j != myeset_orig.
end(); ++j) {
629 if (myfunctor(*j)) neweset_size++;
635 for (; orig != myeset_orig.
end() && filt != myeset.
end(); ++orig, ++filt) {
637 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
643 "Mismatch in items " << *orig <<
" vs. " << *filt
644 <<
" after filtering");
647 while (orig != myeset_orig.
end() && !myfunctor(*orig)) {
653 "Extra items in the filtered eset.");
660 "this",
"line",
"paragraph",
"rubbish"));
664 tout <<
"Original mset pcts:";
669 unsigned int num_items = 0;
674 for ( ; i != mymset1.
end(); ++i, ++c) {
676 if (new_pct != my_pct) {
678 if (changes > 3)
break;
686 tout <<
"Cutoff percent: " << my_pct <<
"\n";
693 tout <<
"Percentages after cutoff:";
699 "Match with % cutoff lost too many items");
704 "Match with % cutoff returned too many items");
714 tout <<
"Original mset pcts:";
720 TEST(mset[0].get_percent() - mset[1].get_percent() >= 2);
722 int cutoff = mset[0].get_percent() + mset[1].get_percent();
746 tout <<
"Original mset pcts:";
754 if (new_percent != percent) {
756 tout <<
"Testing " << percent <<
"% cutoff\n";
761 percent = new_percent;
770 "this",
"line",
"paragraph",
"rubbish"));
774 tout <<
"Original mset weights:";
779 unsigned int num_items = 0;
784 for ( ; i != mymset1.
end(); ++i, ++c) {
786 if (new_wt != my_wt) {
788 if (changes > 3)
break;
796 tout <<
"Cutoff weight: " << my_wt <<
"\n";
803 tout <<
"Weights after cutoff:";
809 "Match with cutoff lost too many items");
812 (mymset2[num_items].get_weight() == my_wt &&
814 "Match with cutoff returned too many items");
820 string term =
"paragraph";
828 myrset.add_document(*i);
829 myrset.add_document(*(++i));
833 for ( ; j != myeset.
end(); ++j) {
839 for ( ; j != myeset2.
end(); ++j) {
840 if (*j == term)
break;
853 for ( ; i != mymset.
end(); ++i) {
867 "Mset was too small to test properly");
880 for ( ; i != mymset1.
end(); ++i, j++) {
895 for ( ; i != mymset1.
end(); ++i) {
913 "Mset was too small to test properly");
926 for ( ; j != mymset2.
end(); ++i, ++j) {
941 for (j = mymset3.
begin(); j != mymset3.
end(); ++j) {
952 list<string> answers_list;
953 answers_list.push_back(
"one");
954 answers_list.push_back(
"two");
955 answers_list.push_back(
"three");
956 answers_list.push_back(
"four");
976 TEST(list == answers_list);
981 list<string> answers_list;
982 answers_list.push_back(
"one");
983 answers_list.push_back(
"two");
984 answers_list.push_back(
"three");
1004 TEST(list == answers_list);
1029 mymset2.
fetch(mymset2[0], mymset2[mymset2.
size() - 1]);
1037 while (it1 != mymset1.
end() && it2 != mymset2.
end()) {
1062 vector<string> terms;
1063 terms.push_back(
"frink");
1208 vector<Xapian::Query> qs;
1209 qs.push_back(
query(
"this"));
1212 qs.begin(), qs.end(), 1);
1230 vector<Xapian::Query> qs;
1231 qs.push_back(
query(
"this"));
1234 qs.begin(), qs.end(), 1);
1270 string term1 =
stemmer(
"word");
1271 string term2 =
stemmer(
"rubbish");
1272 string term3 =
stemmer(
"banana");
1274 vector<string> terms;
1275 terms.push_back(term1);
1276 terms.push_back(term2);
1277 terms.push_back(term3);
1315 "word",
"rubbish",
"fibble");
1333 "word",
"rubbish",
"fibble");
1362 for (
int i = 0; i != 3; ++i) {
1363 v.push_back(
"simpl");
1364 v.push_back(
"queri");
1366 v.push_back(
"rubbish");
1367 v.push_back(
"rubbish");
1368 v.push_back(
"rubbish");
1369 v.push_back(
"word");
1370 v.push_back(
"word");
1371 v.push_back(
"word");
1376 v.begin(), v.end(), n);
1402 string theterm =
stemmer(
"another");
1408 for ( ; i != eset1.
end(); ++i) {
1409 if (*i == theterm) {
1417 for ( ; i != eset2.
end(); ++i) {
1418 if (*i == theterm) {
1442 string term1 =
stemmer(
"word");
1443 string term2 =
stemmer(
"inmemory");
1444 string term3 =
stemmer(
"flibble");
1491 string term1 =
stemmer(
"paragraph");
1492 string term2 =
stemmer(
"another");
1524 bool remote =
get_dbtype().find(
"remote") != string::npos;
1531 myquery =
query(
"word");
1574 if (db.
size() == 1) {
1588 TEST_EQUAL(mymset.get_matches_lower_bound(), 2);
1589 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1590 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1591 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 2);
1592 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1593 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1596 TEST_EQUAL(mymset.get_matches_lower_bound(), 2);
1597 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1598 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1599 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 2);
1600 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1601 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1606 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1607 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1608 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1609 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1610 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1611 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 2);
1614 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1615 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1616 if (db.
size() > 1 && remote) {
1618 TEST_EQUAL(mymset.get_matches_estimated(), 1);
1619 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 1);
1620 TEST_EQUAL(mymset.get_matches_upper_bound(), 1);
1621 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 1);
1623 TEST_EQUAL(mymset.get_matches_estimated(), 2);
1624 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 2);
1625 TEST_EQUAL(mymset.get_matches_upper_bound(), 2);
1626 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(), 1);
1632 TEST_EQUAL(mymset.get_matches_upper_bound(), 1);
1633 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1634 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 1);
1635 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 1);
1638 TEST_EQUAL(mymset.get_matches_lower_bound(), 1);
1639 TEST_EQUAL(mymset.get_matches_estimated(), 1);
1640 TEST_EQUAL(mymset.get_matches_upper_bound(), 1);
1641 TEST_EQUAL(mymset.get_uncollapsed_matches_lower_bound(), 1);
1642 TEST_EQUAL(mymset.get_uncollapsed_matches_estimated(), 1);
1643 TEST_EQUAL(mymset.get_uncollapsed_matches_upper_bound(), 1);
1702 vector<string> v(t, tend);
1706 vector<string>::const_iterator i;
1707 for (i = v.begin(); i != v.end(); ++i) {
1774 for (m = mymset.
begin(); m != mymset.
end(); ++m) ++count;
1786 for (m = mymset.
begin(); m != mymset.
end(); ++m) ++count;
1792 if (value_no == 0) {
1793 TEST(value.size() > 262);
1794 TEST_EQUAL(static_cast<unsigned char>(value[262]), 255);
1802 for (m = mymset.
begin(); m != mymset.
end(); ++m) ++count;
1811 vector<string> terms;
1812 terms.push_back(
stemmer(
"this"));
1813 terms.push_back(
stemmer(
"word"));
1814 terms.push_back(
stemmer(
"of"));
1836 vector<string> terms;
1837 terms.push_back(
stemmer(
"this"));
1838 terms.push_back(
stemmer(
"word"));
1839 terms.push_back(
stemmer(
"of"));
1875 vector<Xapian::Query> nullvec;
1908 mymset = enquire.
get_mset(0, 2, 4);
1910 TEST_REL(mymset.get_matches_lower_bound(),>=,4);
1911 TEST_REL(mymset.get_matches_lower_bound(),>=,4);
1912 TEST_REL(mymset.get_uncollapsed_matches_lower_bound(),>=,4);
1913 TEST_REL(mymset.get_uncollapsed_matches_lower_bound(),>=,4);
1921 for (
int order = 0; order < 3; ++order) {
1934 for (
int sort = 0; sort < 7; ++sort) {
1935 bool reverse = (sort & 1);
1960 mset = enquire.
get_mset(0, 50, 100);
1962 TEST_EQUAL(mset.get_matches_lower_bound(), 60);
1963 TEST_EQUAL(mset.get_matches_estimated(), 60);
1964 TEST_EQUAL(mset.get_matches_upper_bound(), 60);
1965 TEST_EQUAL(mset.get_uncollapsed_matches_lower_bound(), 60);
1966 TEST_EQUAL(mset.get_uncollapsed_matches_estimated(), 60);
1967 TEST_EQUAL(mset.get_uncollapsed_matches_upper_bound(), 60);
1969 mset = enquire.
get_mset(0, 10, 50);
1971 TEST_REL(mset.get_matches_lower_bound(),>=,50);
1972 TEST_REL(mset.get_uncollapsed_matches_lower_bound(),>=,50);
2140 static const char *
const queries[] = {
2143 "leave milk on fridge",
2144 "ordered milk operator",
2145 "ordered phrase operator",
2146 "leave \"milk on fridge\"",
2148 "leave \"milk notpresent\"",
2150 static const double multipliers[] = {
2151 -1000000, -2.5, -1, -0.5, 0, 0.5, 1, 2.5, 1000000,
2155 for (
auto qstr : queries) {
2159 for (
const double *multp = multipliers; multp[0] != multp[1]; ++multp) {
2160 double mult = *multp;
2180 i1 != mset1.
end() && i2 != mset2.
end(); ++i1, ++i2) {
2186 vector<Xapian::docid> ids1;
2187 vector<Xapian::docid> ids2;
2189 i1 != mset1.
end() && i2 != mset2.
end(); ++i1, ++i2) {
2192 ids1.push_back(*i1);
2193 ids2.push_back(*i2);
2195 sort(ids1.begin(), ids1.end());
2222 vector<Xapian::docid> ids1;
2223 set<Xapian::docid> idsin1;
2224 vector<Xapian::docid> ids3;
2231 for (i = mset1.
begin(); i != mset1.
end(); ++i) {
2236 for (i = mset3.
begin(); i != mset3.
end(); ++i) {
2237 if (idsin1.find(*i) != idsin1.end())
2241 sort(ids3.begin(), ids3.end());
2242 ids1.insert(ids1.end(), ids3.begin(), ids3.end());
2245 vector<Xapian::docid> ids5;
2248 for (i = mset5.
begin(); i != mset5.
end(); ++i) {
2282 TEST_EQUAL(mset[0].get_weight(), mset[5].get_weight());
2318 TEST(db2.get_uuid().empty());
2320 db2.add_database(db);
2325 db2.add_database(db);
2326 TEST_EQUAL(uuid1 +
":" + uuid1, db2.get_uuid());
2328 #ifdef XAPIAN_HAS_INMEMORY_BACKEND 2332 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.
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.
bool operator()(const string &tname) const
Do we want this term in the ESet?
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.
Xapian::Weight subclass implementing the BM25 probabilistic formula.
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.