xapian-core
1.4.22
|
tests which work with any backend More...
#include <config.h>
#include "api_anydb.h"
#include <algorithm>
#include <string>
#include <xapian.h>
#include "testsuite.h"
#include "testutils.h"
#include "apitest.h"
#include <list>
Go to the source code of this file.
Classes | |
class | EvenParityExpandFunctor |
Macros | |
#define | XAPIAN_DEPRECATED(X) X |
Functions | |
static void | print_mset_weights (const Xapian::MSet &mset) |
static void | print_mset_percentages (const Xapian::MSet &mset) |
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 Xapian::Query | query (Xapian::Query::op op, Xapian::termcount parameter, 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 Xapian::Query | query (const string &t) |
DEFINE_TESTCASE (zerodocid1, backend) | |
DEFINE_TESTCASE (emptyquery1, backend) | |
DEFINE_TESTCASE (simplequery1, backend) | |
DEFINE_TESTCASE (simplequery2, backend) | |
DEFINE_TESTCASE (simplequery3, backend) | |
DEFINE_TESTCASE (multidb3, backend &&!multi) | |
DEFINE_TESTCASE (multidb4, backend &&!multi) | |
DEFINE_TESTCASE (multidb5, backend &&!multi) | |
DEFINE_TESTCASE (msetmaxitems1, backend) | |
DEFINE_TESTCASE (expandweights1, backend) | |
DEFINE_TESTCASE (expandweights2, backend) | |
DEFINE_TESTCASE (expandweights3, backend) | |
DEFINE_TESTCASE (expandweights4, backend) | |
DEFINE_TESTCASE (expandweights5, backend) | |
DEFINE_TESTCASE (expandweights6, backend) | |
DEFINE_TESTCASE (expandweights7, backend) | |
DEFINE_TESTCASE (expandweights8, backend) | |
DEFINE_TESTCASE (expandmaxitems1, backend) | |
DEFINE_TESTCASE (boolquery1, backend) | |
DEFINE_TESTCASE (msetfirst1, backend) | |
DEFINE_TESTCASE (topercent1, backend) | |
DEFINE_TESTCASE (topercent2, backend) | |
DEFINE_TESTCASE (expandfunctor1, backend) | |
DEFINE_TESTCASE (expanddeciderfilterprefix2, backend) | |
DEFINE_TESTCASE (pctcutoff1, backend) | |
DEFINE_TESTCASE (pctcutoff2, backend) | |
DEFINE_TESTCASE (pctcutoff3, backend) | |
DEFINE_TESTCASE (cutoff1, backend) | |
DEFINE_TESTCASE (allowqterms1, backend) | |
DEFINE_TESTCASE (maxattain1, backend) | |
DEFINE_TESTCASE (reversebool1, backend) | |
DEFINE_TESTCASE (reversebool2, backend) | |
DEFINE_TESTCASE (getmterms1, backend) | |
DEFINE_TESTCASE (getmterms2, backend) | |
DEFINE_TESTCASE (repeatquery1, backend) | |
DEFINE_TESTCASE (fetchdocs1, backend) | |
DEFINE_TESTCASE (absentterm1, backend) | |
DEFINE_TESTCASE (absentterm2, backend) | |
DEFINE_TESTCASE (rset1, backend) | |
DEFINE_TESTCASE (rset2, backend) | |
DEFINE_TESTCASE (rsetmultidb1, backend &&!multi) | |
DEFINE_TESTCASE (rsetmultidb3, backend &&!multi) | |
DEFINE_TESTCASE (eliteset1, backend &&!multi) | |
Simple test of the elite set operator. More... | |
DEFINE_TESTCASE (elitesetmulti1, multi) | |
Multi-backend variant of eliteset1. More... | |
DEFINE_TESTCASE (eliteset2, backend &&!multi) | |
Test that the elite set operator works if the set contains sub-expressions (regression test) More... | |
DEFINE_TESTCASE (elitesetmulti2, multi) | |
Multi-backend variant of eliteset2. More... | |
DEFINE_TESTCASE (eliteset3, backend) | |
Test that elite set doesn't affect query results if we have fewer terms than the threshold. More... | |
DEFINE_TESTCASE (eliteset4, backend &&!multi) | |
Test that elite set doesn't pick terms with 0 frequency. More... | |
DEFINE_TESTCASE (elitesetmulti4, multi) | |
Multi-backend variant of eliteset4. More... | |
DEFINE_TESTCASE (eliteset5, backend) | |
Regression test for problem with excess precision. More... | |
DEFINE_TESTCASE (termlisttermfreq1, backend) | |
Test that the termfreq returned by termlists is correct. More... | |
DEFINE_TESTCASE (qterminfo1, backend) | |
Test the termfreq and termweight info returned for query terms. More... | |
DEFINE_TESTCASE (qterminfo2, backend) | |
Regression test for bug #37. More... | |
DEFINE_TESTCASE (msetzeroitems1, backend) | |
DEFINE_TESTCASE (matches1, backend) | |
DEFINE_TESTCASE (wqf1, backend) | |
DEFINE_TESTCASE (qlen1, backend) | |
DEFINE_TESTCASE (termlist1, backend) | |
DEFINE_TESTCASE (termlist2, backend) | |
static Xapian::TermIterator | test_termlist3_helper () |
DEFINE_TESTCASE (termlist3, backend) | |
DEFINE_TESTCASE (termlist4, backend) | |
DEFINE_TESTCASE (puncterms1, backend) | |
DEFINE_TESTCASE (spaceterms1, backend) | |
DEFINE_TESTCASE (xor1, backend) | |
DEFINE_TESTCASE (xor2, backend) | |
Test that weighted XOR queries work (bug fixed in 1.2.1 and 1.0.21). More... | |
DEFINE_TESTCASE (getdoc1, backend) | |
DEFINE_TESTCASE (emptyop1, backend) | |
DEFINE_TESTCASE (checkatleast1, backend) | |
DEFINE_TESTCASE (checkatleast2, backend) | |
DEFINE_TESTCASE (checkatleast3, backend) | |
DEFINE_TESTCASE (allpostlist1, backend) | |
static void | test_emptyterm1_helper (Xapian::Database &db) |
DEFINE_TESTCASE (emptyterm1, backend) | |
DEFINE_TESTCASE (alldocspl1, writable) | |
DEFINE_TESTCASE (alldocspl2, writable) | |
DEFINE_TESTCASE (scaleweight1, backend) | |
DEFINE_TESTCASE (scaleweight2, backend) | |
DEFINE_TESTCASE (bm25weight1, backend) | |
DEFINE_TESTCASE (tradweight1, backend) | |
DEFINE_TESTCASE (tradweight4, backend) | |
DEFINE_TESTCASE (uuid1, backend &&!multi) | |
tests which work with any backend
Definition in file api_anydb.cc.
#define XAPIAN_DEPRECATED | ( | X | ) | X |
Definition at line 33 of file api_anydb.cc.
DEFINE_TESTCASE | ( | zerodocid1 | , |
backend | |||
) |
Definition at line 118 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST_AND_EXPLAIN, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | emptyquery1 | , |
backend | |||
) |
Definition at line 141 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::Query::OP_AND, Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | simplequery1 | , |
backend | |||
) |
Definition at line 167 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | simplequery2 | , |
backend | |||
) |
Definition at line 175 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), mset_expect_order(), Xapian::Enquire::set_query(), and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | simplequery3 | , |
backend | |||
) |
Definition at line 198 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | multidb3 | , |
backend &&! | multi | ||
) |
Definition at line 210 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | multidb4 | , |
backend &&! | multi | ||
) |
Definition at line 226 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | multidb5 | , |
backend &&! | multi | ||
) |
Definition at line 243 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_AND, query(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | msetmaxitems1 | , |
backend | |||
) |
Definition at line 260 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | expandweights1 | , |
backend | |||
) |
Definition at line 273 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, TEST_REL, and Xapian::Enquire::USE_EXACT_TERMFREQ.
DEFINE_TESTCASE | ( | expandweights2 | , |
backend | |||
) |
Definition at line 301 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights3 | , |
backend | |||
) |
Definition at line 324 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights4 | , |
backend | |||
) |
Definition at line 348 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights5 | , |
backend | |||
) |
Definition at line 368 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_expansion_scheme(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandweights6 | , |
backend | |||
) |
Definition at line 390 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_expansion_scheme(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, TEST_REL, and Xapian::Enquire::USE_EXACT_TERMFREQ.
DEFINE_TESTCASE | ( | expandweights7 | , |
backend | |||
) |
Definition at line 412 of file api_anydb.cc.
References get_database(), Xapian::Enquire::set_expansion_scheme(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | expandweights8 | , |
backend | |||
) |
Definition at line 420 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::ESet::back(), Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::ESetIterator::get_weight(), Xapian::Enquire::set_query(), TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandmaxitems1 | , |
backend | |||
) |
Definition at line 445 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::ESet::get_ebound(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_REL, and tout.
DEFINE_TESTCASE | ( | boolquery1 | , |
backend | |||
) |
Definition at line 464 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | msetfirst1 | , |
backend | |||
) |
Definition at line 484 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_range_is_same(), query(), Xapian::Enquire::set_query(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | topercent1 | , |
backend | |||
) |
Definition at line 498 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_percent(), Xapian::MSetIterator::get_weight(), query(), Xapian::Enquire::set_query(), and TEST_AND_EXPLAIN.
DEFINE_TESTCASE | ( | topercent2 | , |
backend | |||
) |
Definition at line 519 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::MSet::get_max_attained(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_REL.
DEFINE_TESTCASE | ( | expandfunctor1 | , |
backend | |||
) |
Definition at line 582 of file api_anydb.cc.
References Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::ESetIterator::get_weight(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, TEST_EQUAL, tout, and verbose.
DEFINE_TESTCASE | ( | expanddeciderfilterprefix2 | , |
backend | |||
) |
Definition at line 641 of file api_anydb.cc.
References Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::ESetIterator::get_weight(), Xapian::Enquire::set_query(), Xapian::ESet::size(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | pctcutoff1 | , |
backend | |||
) |
Definition at line 691 of file api_anydb.cc.
References Xapian::MSet::back(), Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, print_mset_percentages(), query(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_AND_EXPLAIN, tout, and verbose.
DEFINE_TESTCASE | ( | pctcutoff2 | , |
backend | |||
) |
Definition at line 742 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::Query::OP_AND_NOT, print_mset_percentages(), Xapian::Enquire::set_collapse_key(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_REL, tout, and verbose.
DEFINE_TESTCASE | ( | pctcutoff3 | , |
backend | |||
) |
Definition at line 774 of file api_anydb.cc.
References Xapian::MSet::back(), Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_percent(), print_mset_percentages(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, tout, and verbose.
DEFINE_TESTCASE | ( | cutoff1 | , |
backend | |||
) |
Definition at line 801 of file api_anydb.cc.
References Xapian::MSet::back(), Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), Xapian::Query::OP_OR, print_mset_weights(), query(), Xapian::Enquire::set_cutoff(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_AND_EXPLAIN, tout, and verbose.
DEFINE_TESTCASE | ( | allowqterms1 | , |
backend | |||
) |
Definition at line 852 of file api_anydb.cc.
References Xapian::ESet::begin(), Xapian::MSet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::INCLUDE_QUERY_TERMS, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | maxattain1 | , |
backend | |||
) |
Definition at line 880 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::MSet::get_max_attained(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | reversebool1 | , |
backend | |||
) |
Definition at line 894 of file api_anydb.cc.
References Xapian::Enquire::ASCENDING, Xapian::MSet::begin(), Xapian::Enquire::DESCENDING, Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | reversebool2 | , |
backend | |||
) |
Definition at line 939 of file api_anydb.cc.
References Xapian::Enquire::ASCENDING, Xapian::MSet::begin(), Xapian::Enquire::DESCENDING, Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), TEST, TEST_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | getmterms1 | , |
backend | |||
) |
Definition at line 985 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), TEST, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | getmterms2 | , |
backend | |||
) |
Definition at line 1014 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), TEST, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | repeatquery1 | , |
backend | |||
) |
Definition at line 1042 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | fetchdocs1 | , |
backend | |||
) |
Definition at line 1054 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::MSet::fetch(), Xapian::Document::get_data(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | absentterm1 | , |
backend | |||
) |
Definition at line 1084 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | absentterm2 | , |
backend | |||
) |
Definition at line 1094 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | rset1 | , |
backend | |||
) |
Definition at line 1107 of file api_anydb.cc.
References Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | rset2 | , |
backend | |||
) |
Definition at line 1127 of file api_anydb.cc.
References Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | rsetmultidb1 | , |
backend &&! | multi | ||
) |
Definition at line 1145 of file api_anydb.cc.
References Xapian::Database::add_database(), Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), mset_range_is_same_weights(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), TEST, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | rsetmultidb3 | , |
backend &&! | multi | ||
) |
Definition at line 1181 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, query(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | eliteset1 | , |
backend &&! | multi | ||
) |
Simple test of the elite set operator.
Definition at line 1188 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | elitesetmulti1 | , |
multi | |||
) |
Multi-backend variant of eliteset1.
Definition at line 1207 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::MSet::get_max_attained(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | eliteset2 | , |
backend &&! | multi | ||
) |
Test that the elite set operator works if the set contains sub-expressions (regression test)
Definition at line 1236 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_AND, Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | elitesetmulti2 | , |
multi | |||
) |
Multi-backend variant of eliteset2.
Definition at line 1258 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::MSet::get_max_attained(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_AND, Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | eliteset3 | , |
backend | |||
) |
Test that elite set doesn't affect query results if we have fewer terms than the threshold.
Definition at line 1294 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termfreq(), Xapian::MSet::get_termweight(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_OR, Xapian::Enquire::set_query(), stemmer, and TEST_EQUAL.
DEFINE_TESTCASE | ( | eliteset4 | , |
backend &&! | multi | ||
) |
Test that elite set doesn't pick terms with 0 frequency.
Definition at line 1340 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | elitesetmulti4 | , |
multi | |||
) |
Multi-backend variant of eliteset4.
Definition at line 1362 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::MSet::get_max_attained(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_ELITE_SET, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | eliteset5 | , |
backend | |||
) |
Regression test for problem with excess precision.
Definition at line 1391 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_SCALE_WEIGHT, and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | termlisttermfreq1 | , |
backend | |||
) |
Test that the termfreq returned by termlists is correct.
Definition at line 1423 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::ESet::begin(), Xapian::ESet::end(), get_database(), Xapian::Enquire::get_eset(), Xapian::ESetIterator::get_weight(), stemmer, TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | qterminfo1 | , |
backend | |||
) |
Test the termfreq and termweight info returned for query terms.
Definition at line 1465 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termfreq(), Xapian::MSet::get_termweight(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), stemmer, TEST_EQUAL, TEST_EXCEPTION, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | qterminfo2 | , |
backend | |||
) |
Regression test for bug #37.
Definition at line 1518 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::MSet::get_termweight(), Xapian::Query::OP_AND, Xapian::Query::OP_AND_NOT, query(), Xapian::Enquire::set_query(), stemmer, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | msetzeroitems1 | , |
backend | |||
) |
Definition at line 1546 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_max_possible(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | matches1 | , |
backend | |||
) |
Definition at line 1557 of file api_anydb.cc.
References get_database(), get_dbtype(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), startswith(), TEST_EQUAL, and TEST_REL.
DEFINE_TESTCASE | ( | wqf1 | , |
backend | |||
) |
Definition at line 1681 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), Xapian::Enquire::set_query(), and TEST.
DEFINE_TESTCASE | ( | qlen1 | , |
backend | |||
) |
Definition at line 1695 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::MSetIterator::get_weight(), Xapian::Enquire::set_query(), and TEST.
DEFINE_TESTCASE | ( | termlist1 | , |
backend | |||
) |
Definition at line 1709 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | termlist2 | , |
backend | |||
) |
Definition at line 1723 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | termlist3 | , |
backend | |||
) |
Definition at line 1757 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST_EQUAL, and test_termlist3_helper().
DEFINE_TESTCASE | ( | termlist4 | , |
backend | |||
) |
Definition at line 1771 of file api_anydb.cc.
References get_database(), Xapian::TermIterator::skip_to(), and Xapian::Database::termlist_begin().
DEFINE_TESTCASE | ( | puncterms1 | , |
backend | |||
) |
Definition at line 1779 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | spaceterms1 | , |
backend | |||
) |
Definition at line 1797 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::Document::get_data(), get_database(), Xapian::MSetIterator::get_document(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Enquire::set_query(), stemmer, TEST, TEST_EQUAL, TEST_MSET_SIZE, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | xor1 | , |
backend | |||
) |
Definition at line 1841 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), and stemmer.
DEFINE_TESTCASE | ( | xor2 | , |
backend | |||
) |
Test that weighted XOR queries work (bug fixed in 1.2.1 and 1.0.21).
Definition at line 1866 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_XOR, query(), Xapian::Enquire::set_query(), and stemmer.
DEFINE_TESTCASE | ( | getdoc1 | , |
backend | |||
) |
Definition at line 1890 of file api_anydb.cc.
References get_database(), Xapian::Database::get_document(), Xapian::Document::set_data(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | emptyop1 | , |
backend | |||
) |
Definition at line 1907 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_matching_terms_end(), Xapian::Enquire::get_mset(), Xapian::Query::OP_XOR, Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | checkatleast1 | , |
backend | |||
) |
Definition at line 1924 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | checkatleast2 | , |
backend | |||
) |
Definition at line 1933 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::Enquire::set_query(), TEST_EQUAL, TEST_MSET_SIZE, and TEST_REL.
DEFINE_TESTCASE | ( | checkatleast3 | , |
backend | |||
) |
Definition at line 1951 of file api_anydb.cc.
References Xapian::Enquire::ASCENDING, Xapian::Enquire::DESCENDING, Xapian::Enquire::DONT_CARE, get_database(), Xapian::MSet::get_matches_estimated(), Xapian::MSet::get_matches_lower_bound(), Xapian::MSet::get_matches_upper_bound(), Xapian::Enquire::get_mset(), Xapian::MSet::get_uncollapsed_matches_estimated(), Xapian::MSet::get_uncollapsed_matches_lower_bound(), Xapian::MSet::get_uncollapsed_matches_upper_bound(), Xapian::Enquire::set_docid_order(), Xapian::Enquire::set_query(), Xapian::Enquire::set_sort_by_relevance(), Xapian::Enquire::set_sort_by_relevance_then_value(), Xapian::Enquire::set_sort_by_value(), Xapian::Enquire::set_sort_by_value_then_relevance(), TEST_EQUAL, TEST_MSET_SIZE, and TEST_REL.
DEFINE_TESTCASE | ( | allpostlist1 | , |
backend | |||
) |
Definition at line 2012 of file api_anydb.cc.
References get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::PostingIterator::skip_to(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | emptyterm1 | , |
backend | |||
) |
Definition at line 2047 of file api_anydb.cc.
References get_database(), Xapian::Database::get_doccount(), test_emptyterm1_helper(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | alldocspl1 | , |
writable | |||
) |
Definition at line 2062 of file api_anydb.cc.
References Xapian::Document::add_value(), Xapian::PostingIterator::get_doclength(), Xapian::PostingIterator::get_unique_terms(), Xapian::PostingIterator::get_wdf(), get_writable_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | alldocspl2 | , |
writable | |||
) |
Definition at line 2080 of file api_anydb.cc.
References Xapian::Document::add_value(), Xapian::WritableDatabase::commit(), Xapian::WritableDatabase::delete_document(), Xapian::PostingIterator::get_doclength(), Xapian::PostingIterator::get_unique_terms(), Xapian::PostingIterator::get_wdf(), get_writable_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | scaleweight1 | , |
backend | |||
) |
Definition at line 2167 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Query::get_description(), Xapian::Enquire::get_mset(), Xapian::Query::OP_SCALE_WEIGHT, Xapian::QueryParser::parse_query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, TEST_EXCEPTION, TEST_NOT_EQUAL_DOUBLE, and tout.
DEFINE_TESTCASE | ( | scaleweight2 | , |
backend | |||
) |
Definition at line 2236 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Query::OP_SCALE_WEIGHT, Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | bm25weight1 | , |
backend | |||
) |
Definition at line 2289 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | tradweight1 | , |
backend | |||
) |
Definition at line 2298 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::Enquire::set_weighting_scheme(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | tradweight4 | , |
backend | |||
) |
Definition at line 2319 of file api_anydb.cc.
References Xapian::RSet::add_document(), get_database(), Xapian::Enquire::get_mset(), mset_expect_order(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().
DEFINE_TESTCASE | ( | uuid1 | , |
backend &&! | multi | ||
) |
Definition at line 2342 of file api_anydb.cc.
References Xapian::DB_BACKEND_INMEMORY, get_database(), Xapian::Database::get_uuid(), SKIP_TEST_FOR_BACKEND, TEST, and TEST_EQUAL.
|
static |
Definition at line 54 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), and tout.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 45 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::MSetIterator::get_weight(), and tout.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 63 of file api_anydb.cc.
References stemmer.
Referenced by Xapian::Weight::Internal::accumulate_stats(), Term::as_range_query(), DEFINE_TESTCASE(), LocalSubMatch::get_postlist(), GlassDatabase::get_postlist_cursor(), ChertDatabase::get_postlist_cursor(), Xapian::Database::Internal::Internal(), main(), RemoteServer::msg_query(), Xapian::MSet::Internal::snippet(), and ProbQuery::~ProbQuery().
|
static |
Definition at line 86 of file api_anydb.cc.
References stemmer.
|
static |
Definition at line 109 of file api_anydb.cc.
|
static |
Definition at line 2037 of file api_anydb.cc.
References Xapian::Database::get_collection_freq(), Xapian::Database::get_doccount(), Xapian::Database::get_termfreq(), Xapian::Database::positionlist_begin(), Xapian::Database::term_exists(), TEST_EQUAL, and TEST_EXCEPTION.
Referenced by DEFINE_TESTCASE().
|
static |
Definition at line 1750 of file api_anydb.cc.
References get_database(), and Xapian::Database::termlist_begin().
Referenced by DEFINE_TESTCASE().