#include <config.h>
#include "api_anydb.h"
#include <algorithm>
#include <string>
#include <xapian.h>
#include "backendmanager_local.h"
#include "testsuite.h"
#include "testutils.h"
#include "utils.h"
#include "apitest.h"
#include <list>
Include dependency graph for api_anydb.cc:
Go to the source code of this file.
Classes | |
class | myExpandFunctor |
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, string t1="", string t2="", string t3="", string t4="", string t5="", string t6="", string t7="", string t8="", string t9="", string t10="") |
static Xapian::Query | query (Xapian::Query::op op, Xapian::termcount parameter, string t1="", string t2="", string t3="", string t4="", string t5="", string t6="", string t7="", string t8="", string t9="", string t10="") |
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 (wildquery1, backend) | |
DEFINE_TESTCASE (multidb1, backend) | |
DEFINE_TESTCASE (multidb2, backend &&!multi) | |
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 (expandmaxitems1, backend) | |
DEFINE_TESTCASE (boolquery1, backend) | |
DEFINE_TESTCASE (msetfirst1, backend) | |
DEFINE_TESTCASE (topercent1, backend) | |
DEFINE_TESTCASE (topercent2, backend) | |
DEFINE_TESTCASE (expandfunctor1, backend) | |
DEFINE_TESTCASE (pctcutoff1, backend) | |
DEFINE_TESTCASE (pctcutoff2, 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 (poscollapse1, 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) | |
Simple test of the elite set operator. | |
DEFINE_TESTCASE (eliteset2, backend) | |
Test that the elite set operator works if the set contains sub-expressions (regression test). | |
DEFINE_TESTCASE (eliteset3, backend) | |
Test that elite set doesn't affect query results if we have fewer terms than the threshold. | |
DEFINE_TESTCASE (eliteset4, backend) | |
Test that elite set doesn't pick terms with 0 frequency. | |
DEFINE_TESTCASE (eliteset5, backend) | |
Regression test for problem with excess precision. | |
DEFINE_TESTCASE (termlisttermfreq1, backend) | |
Test that the termfreq returned by termlists is correct. | |
DEFINE_TESTCASE (qterminfo1, backend) | |
Test the termfrequency and termweight info returned for query terms. | |
DEFINE_TESTCASE (qterminfo2, backend) | |
Regression test for bug #37. | |
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 (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 (valuerange1, backend) | |
DEFINE_TESTCASE (valuerange2, backend &&writable) | |
DEFINE_TESTCASE (alldocspl1, backend &&writable) | |
DEFINE_TESTCASE (alldocspl2, backend &&writable) | |
DEFINE_TESTCASE (valuege1, backend) | |
DEFINE_TESTCASE (valuele1, backend) | |
DEFINE_TESTCASE (scaleweight1, backend) | |
DEFINE_TESTCASE (scaleweight2, backend) | |
DEFINE_TESTCASE (bm25weight1, backend) | |
DEFINE_TESTCASE (tradweight1, backend) |
static void print_mset_weights | ( | const Xapian::MSet & | mset | ) | [static] |
Definition at line 44 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), Xapian::MSetIterator::get_weight(), and tout.
Referenced by DEFINE_TESTCASE().
static void print_mset_percentages | ( | const Xapian::MSet & | mset | ) | [static] |
Definition at line 53 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), and tout.
Referenced by DEFINE_TESTCASE().
static Xapian::Query query | ( | Xapian::Query::op | op, | |
string | t1 = "" , |
|||
string | t2 = "" , |
|||
string | t3 = "" , |
|||
string | t4 = "" , |
|||
string | t5 = "" , |
|||
string | t6 = "" , |
|||
string | t7 = "" , |
|||
string | t8 = "" , |
|||
string | t9 = "" , |
|||
string | t10 = "" | |||
) | [static] |
Definition at line 62 of file api_anydb.cc.
References stemmer.
Referenced by DEFINE_TESTCASE(), QueryOptimiser::do_and_like(), QueryOptimiser::do_leaf(), QueryOptimiser::do_or_like(), QueryOptimiser::do_subquery(), LocalSubMatch::LocalSubMatch(), main(), QueryOptimiser::optimise_query(), LocalSubMatch::postlist_from_op_leaf_query(), RemoteDatabase::set_query(), Xapian::Enquire::set_query(), test_qp_odd_chars1(), test_qp_value_range3(), test_serialisequery1(), and ProbQuery::~ProbQuery().
static Xapian::Query query | ( | Xapian::Query::op | op, | |
Xapian::termcount | parameter, | |||
string | t1 = "" , |
|||
string | t2 = "" , |
|||
string | t3 = "" , |
|||
string | t4 = "" , |
|||
string | t5 = "" , |
|||
string | t6 = "" , |
|||
string | t7 = "" , |
|||
string | t8 = "" , |
|||
string | t9 = "" , |
|||
string | t10 = "" | |||
) | [static] |
static Xapian::Query query | ( | const string & | t | ) | [static] |
Definition at line 105 of file api_anydb.cc.
DEFINE_TESTCASE | ( | zerodocid1 | , | |
backend | ||||
) |
Definition at line 114 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 139 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::Query::OP_AND, Xapian::Enquire::set_query(), TEST_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | simplequery1 | , | |
backend | ||||
) |
Definition at line 161 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 170 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 195 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), query(), Xapian::Enquire::set_query(), and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | wildquery1 | , | |
backend | ||||
) |
Definition at line 208 of file api_anydb.cc.
References Xapian::QueryParser::FLAG_LOVEHATE, Xapian::QueryParser::FLAG_WILDCARD, get_database(), Xapian::Query::get_description(), Xapian::Enquire::get_mset(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_database(), Xapian::Enquire::set_query(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_ALL, TEST_MSET_SIZE, and tout.
DEFINE_TESTCASE | ( | multidb1 | , | |
backend | ||||
) |
Definition at line 243 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), mset_range_is_same_weights(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | multidb2 | , | |
backend &&! | multi | |||
) |
Definition at line 268 of file api_anydb.cc.
References Xapian::Database::add_database(), get_database(), Xapian::Enquire::get_mset(), mset_range_is_same_weights(), Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | multidb3 | , | |
backend &&! | multi | |||
) |
Definition at line 293 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 311 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 330 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 349 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 364 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and Xapian::Enquire::USE_EXACT_TERMFREQ.
DEFINE_TESTCASE | ( | expandweights2 | , | |
backend | ||||
) |
Definition at line 385 of file api_anydb.cc.
References Xapian::RSet::add_document(), Xapian::MSet::begin(), get_database(), get_dbtype(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), TEST_EQUAL, TEST_EQUAL_DOUBLE, and TEST_NOT_EQUAL_DOUBLE.
DEFINE_TESTCASE | ( | expandmaxitems1 | , | |
backend | ||||
) |
Definition at line 417 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_eset(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), Xapian::ESet::size(), Xapian::MSet::size(), TEST, TEST_EQUAL, and tout.
DEFINE_TESTCASE | ( | boolquery1 | , | |
backend | ||||
) |
Definition at line 437 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 458 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 473 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 495 of file api_anydb.cc.
References BackendManagerLocal, Xapian::MSet::begin(), Xapian::MSet::convert_to_percent(), Xapian::MSet::end(), get_database(), test_driver::get_srcdir(), mset_range_is_same_percents(), Xapian::Query::OP_OR, query(), Xapian::MSet::size(), TEST, TEST_EQUAL, TEST_GREATER, and TEST_LESSER.
DEFINE_TESTCASE | ( | expandfunctor1 | , | |
backend | ||||
) |
Definition at line 559 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 | ( | pctcutoff1 | , | |
backend | ||||
) |
Definition at line 620 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 673 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::Enquire::get_mset(), 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, tout, and verbose.
DEFINE_TESTCASE | ( | cutoff1 | , | |
backend | ||||
) |
Definition at line 702 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 755 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 783 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 799 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_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | reversebool2 | , | |
backend | ||||
) |
Definition at line 845 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_AND_EXPLAIN, and TEST_EQUAL.
DEFINE_TESTCASE | ( | getmterms1 | , | |
backend | ||||
) |
Definition at line 891 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 922 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 | ( | poscollapse1 | , | |
backend | ||||
) |
Definition at line 952 of file api_anydb.cc.
References get_database(), Xapian::Query::get_description(), Xapian::Enquire::get_mset(), Xapian::Query::OP_OR, Xapian::Enquire::set_query(), TEST_EQUAL, tout, and verbose.
DEFINE_TESTCASE | ( | repeatquery1 | , | |
backend | ||||
) |
Definition at line 976 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 990 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 1022 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 1034 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 1049 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 1071 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 1091 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 1129 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 | ||||
) |
Simple test of the elite set operator.
Definition at line 1137 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(), SKIP_TEST_FOR_BACKEND, and TEST_EQUAL.
DEFINE_TESTCASE | ( | eliteset2 | , | |
backend | ||||
) |
Test that the elite set operator works if the set contains sub-expressions (regression test).
Definition at line 1162 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(), SKIP_TEST_FOR_BACKEND, and TEST_EQUAL.
DEFINE_TESTCASE | ( | eliteset3 | , | |
backend | ||||
) |
Test that elite set doesn't affect query results if we have fewer terms than the threshold.
Definition at line 1194 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 | ||||
) |
Test that elite set doesn't pick terms with 0 frequency.
Definition at line 1241 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(), SKIP_TEST_FOR_BACKEND, TEST_EQUAL, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | eliteset5 | , | |
backend | ||||
) |
Regression test for problem with excess precision.
Definition at line 1270 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Query::OP_ELITE_SET, Xapian::Query::OP_SCALE_WEIGHT, Xapian::Enquire::set_query(), and SKIP_TEST_FOR_BACKEND.
DEFINE_TESTCASE | ( | termlisttermfreq1 | , | |
backend | ||||
) |
Test that the termfreq returned by termlists is correct.
Definition at line 1304 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 termfrequency and termweight info returned for query terms.
Definition at line 1348 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 1404 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 1429 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 1442 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::Query::OP_AND, Xapian::Query::OP_OR, query(), Xapian::Enquire::set_query(), TEST, and TEST_EQUAL.
DEFINE_TESTCASE | ( | wqf1 | , | |
backend | ||||
) |
Definition at line 1522 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST.
DEFINE_TESTCASE | ( | qlen1 | , | |
backend | ||||
) |
Definition at line 1537 of file api_anydb.cc.
References Xapian::MSet::begin(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and TEST.
DEFINE_TESTCASE | ( | termlist1 | , | |
backend | ||||
) |
Definition at line 1552 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | termlist2 | , | |
backend | ||||
) |
Definition at line 1567 of file api_anydb.cc.
References get_database(), Xapian::Database::termlist_begin(), Xapian::Database::termlist_end(), TEST_EQUAL, and TEST_NOT_EQUAL.
static Xapian::TermIterator test_termlist3_helper | ( | ) | [static] |
Definition at line 1595 of file api_anydb.cc.
References get_database(), and Xapian::Database::termlist_begin().
Referenced by DEFINE_TESTCASE().
DEFINE_TESTCASE | ( | termlist3 | , | |
backend | ||||
) |
Definition at line 1602 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 1617 of file api_anydb.cc.
References get_database(), Xapian::TermIterator::skip_to(), and Xapian::Database::termlist_begin().
DEFINE_TESTCASE | ( | puncterms1 | , | |
backend | ||||
) |
Definition at line 1626 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), and Xapian::Enquire::set_query().
DEFINE_TESTCASE | ( | spaceterms1 | , | |
backend | ||||
) |
Definition at line 1646 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), stemmer, TEST, TEST_EQUAL, TEST_MSET_SIZE, and TEST_NOT_EQUAL.
DEFINE_TESTCASE | ( | xor1 | , | |
backend | ||||
) |
Definition at line 1692 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 | ( | getdoc1 | , | |
backend | ||||
) |
Definition at line 1713 of file api_anydb.cc.
References get_database(), Xapian::Database::get_document(), TEST_EQUAL, and TEST_EXCEPTION.
DEFINE_TESTCASE | ( | emptyop1 | , | |
backend | ||||
) |
Definition at line 1731 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_matching_terms_begin(), Xapian::Enquire::get_mset(), Xapian::Query::OP_XOR, Xapian::Enquire::set_query(), TEST_EXCEPTION, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | checkatleast1 | , | |
backend | ||||
) |
Definition at line 1746 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 1757 of file api_anydb.cc.
References get_database(), Xapian::MSet::get_matches_lower_bound(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), TEST_EQUAL, TEST_GREATER_OR_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | checkatleast3 | , | |
backend | ||||
) |
Definition at line 1773 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::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, TEST_EQUAL, and TEST_MSET_SIZE.
DEFINE_TESTCASE | ( | allpostlist1 | , | |
backend | ||||
) |
Definition at line 1828 of file api_anydb.cc.
References get_database(), Xapian::Database::postlist_begin(), Xapian::Database::postlist_end(), Xapian::PostingIterator::skip_to(), and TEST_EQUAL.
static void test_emptyterm1_helper | ( | Xapian::Database & | db | ) | [static] |
Definition at line 1855 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().
DEFINE_TESTCASE | ( | emptyterm1 | , | |
backend | ||||
) |
Definition at line 1865 of file api_anydb.cc.
References get_database(), Xapian::Database::get_doccount(), test_emptyterm1_helper(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | valuerange1 | , | |
backend | ||||
) |
Definition at line 1882 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Query::OP_VALUE_RANGE, query(), Xapian::Enquire::set_query(), TEST, and tout.
DEFINE_TESTCASE | ( | valuerange2 | , | |
backend && | writable | |||
) |
Definition at line 1918 of file api_anydb.cc.
References Xapian::Document::add_value(), Xapian::Enquire::get_mset(), get_writable_database(), Xapian::Query::OP_VALUE_LE, query(), Xapian::WritableDatabase::replace_document(), Xapian::Document::set_data(), Xapian::Enquire::set_query(), Xapian::MSet::size(), and TEST_EQUAL.
DEFINE_TESTCASE | ( | alldocspl1 | , | |
backend && | writable | |||
) |
Definition at line 1936 of file api_anydb.cc.
References Xapian::Document::add_value(), Xapian::PostingIterator::get_doclength(), 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 | , | |
backend && | writable | |||
) |
Definition at line 1955 of file api_anydb.cc.
References Xapian::Document::add_value(), Xapian::WritableDatabase::delete_document(), Xapian::WritableDatabase::flush(), Xapian::PostingIterator::get_doclength(), 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 | ( | valuege1 | , | |
backend | ||||
) |
Definition at line 2037 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Query::OP_VALUE_GE, query(), Xapian::Enquire::set_query(), TEST, and tout.
DEFINE_TESTCASE | ( | valuele1 | , | |
backend | ||||
) |
Definition at line 2069 of file api_anydb.cc.
References Xapian::MSet::begin(), Xapian::MSet::end(), get_database(), Xapian::Database::get_document(), Xapian::Database::get_lastdocid(), Xapian::Enquire::get_mset(), Xapian::Document::get_value(), Xapian::Query::OP_VALUE_LE, query(), Xapian::Enquire::set_query(), TEST, and tout.
DEFINE_TESTCASE | ( | scaleweight1 | , | |
backend | ||||
) |
Definition at line 2101 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 2171 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 2225 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 2236 of file api_anydb.cc.
References get_database(), Xapian::Enquire::get_mset(), Xapian::Enquire::set_query(), and Xapian::Enquire::set_weighting_scheme().