#include <config.h>#include <xapian.h>#include "cputimer.h"#include "str.h"#include "stringutils.h"#include "utils.h"#include <cmath>#include <iostream>#include <string>#include <vector>#include <stdlib.h>#include "testsuite.h"#include "testutils.h"

Go to the source code of this file.
| #define END_OF_TESTCASES {0, 0} |
Definition at line 41 of file queryparsertest.cc.
| #define TESTCASE | ( | S | ) | {#S, test_##S} |
Definition at line 40 of file queryparsertest.cc.
| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 2526 of file queryparsertest.cc.
References test_driver::parse_command_line(), and test_driver::run().
| static void qp_scale1_helper | ( | const Xapian::Database & | db, | |
| const string & | q, | |||
| unsigned | n, | |||
| unsigned | flags | |||
| ) | [static] |
Definition at line 2156 of file queryparsertest.cc.
References SKIP_TEST, TEST_REL, time_query_parse(), and tout.
Referenced by test_qp_scale1().
| static bool test_qp_default_op1 | ( | ) | [static] |
Definition at line 732 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_prefix(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::Query::OP_AND, Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_default_op(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_default_op2 | ( | ) | [static] |
Regression test for bug with default_op set such that we get an exception.
Definition at line 2461 of file queryparsertest.cc.
References Xapian::Query::OP_AND_MAYBE, Xapian::Query::OP_AND_NOT, Xapian::Query::OP_FILTER, Xapian::Query::OP_SCALE_WEIGHT, Xapian::Query::OP_VALUE_GE, Xapian::Query::OP_VALUE_LE, Xapian::Query::OP_VALUE_RANGE, Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_default_op(), TEST_EXCEPTION, and tout.
| static bool test_qp_default_prefix1 | ( | ) | [static] |
Definition at line 766 of file queryparsertest.cc.
References Xapian::QueryParser::add_prefix(), Xapian::QueryParser::FLAG_BOOLEAN, Xapian::Query::get_description(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, and TEST_STRINGS_EQUAL.
| static bool test_qp_default_prefix2 | ( | ) | [static] |
Definition at line 787 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_prefix(), Xapian::QueryParser::FLAG_BOOLEAN, Xapian::QueryParser::FLAG_PHRASE, Xapian::Query::get_description(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_EXCEPTION, and TEST_STRINGS_EQUAL.
| static bool test_qp_flag_bool_any_case1 | ( | ) | [static] |
Definition at line 1151 of file queryparsertest.cc.
References Xapian::Query::get_description(), Xapian::QueryParser::parse_query(), and TEST_STRINGS_EQUAL.
| static bool test_qp_flag_partial1 | ( | ) | [static] |
Definition at line 1030 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_document(), Xapian::QueryParser::add_prefix(), Xapian::Document::add_term(), Xapian::QueryParser::FLAG_PARTIAL, Xapian::QueryParser::FLAG_WILDCARD, Xapian::Query::get_description(), Xapian::InMemory::open(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_database(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), SKIP_TEST, Xapian::QueryParser::STEM_ALL, Xapian::QueryParser::STEM_NONE, Xapian::QueryParser::STEM_SOME, stemmer, and TEST_STRINGS_EQUAL.
| static bool test_qp_flag_pure_not1 | ( | ) | [static] |
Definition at line 1226 of file queryparsertest.cc.
References Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_flag_wildcard1 | ( | ) | [static] |
Definition at line 839 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::QueryParser::FLAG_LOVEHATE, Xapian::QueryParser::FLAG_WILDCARD, Xapian::Query::get_description(), Xapian::Query::OP_AND, Xapian::InMemory::open(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_database(), Xapian::QueryParser::set_default_op(), SKIP_TEST, and TEST_STRINGS_EQUAL.
| static void test_qp_flag_wildcard1_helper | ( | const Xapian::Database & | db, | |
| Xapian::termcount | max_expansion, | |||
| const string & | query_string | |||
| ) | [static] |
Definition at line 968 of file queryparsertest.cc.
References Xapian::QueryParser::FLAG_WILDCARD, Xapian::Enquire::get_mset(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_database(), Xapian::QueryParser::set_max_wildcard_expansion(), and Xapian::Enquire::set_query().
Referenced by test_qp_flag_wildcard3().
| static bool test_qp_flag_wildcard2 | ( | ) | [static] |
Definition at line 943 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_document(), Xapian::QueryParser::add_prefix(), Xapian::Document::add_term(), Xapian::QueryParser::FLAG_WILDCARD, Xapian::Query::get_description(), Xapian::InMemory::open(), Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_database(), SKIP_TEST, and TEST_STRINGS_EQUAL.
| static bool test_qp_flag_wildcard3 | ( | ) | [static] |
Definition at line 984 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), Xapian::InMemory::open(), SKIP_TEST, TEST_EXCEPTION, and test_qp_flag_wildcard1_helper().
| static bool test_qp_near1 | ( | ) | [static] |
Definition at line 2263 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_prefix(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::Query::OP_NEAR, Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_default_op(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_odd_chars1 | ( | ) | [static] |
Definition at line 828 of file queryparsertest.cc.
References Xapian::Query::get_description(), Xapian::QueryParser::parse_query(), query(), TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_phrase1 | ( | ) | [static] |
Definition at line 2338 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_prefix(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::Query::OP_PHRASE, Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_default_op(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_scale1 | ( | ) | [static] |
Definition at line 2188 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_synonym(), Xapian::WritableDatabase::commit(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS, Xapian::QueryParser::FLAG_DEFAULT, Xapian::QueryParser::FLAG_SYNONYM, mkdir(), and qp_scale1_helper().
| static bool test_qp_spell1 | ( | ) | [static] |
Definition at line 1798 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_document(), Xapian::WritableDatabase::add_spelling(), Xapian::Document::add_term(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_BOOLEAN, Xapian::QueryParser::FLAG_SPELLING_CORRECTION, Xapian::QueryParser::get_corrected_query_string(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_spell2 | ( | ) | [static] |
Definition at line 1834 of file queryparsertest.cc.
References Xapian::Database::add_database(), Xapian::WritableDatabase::add_spelling(), Xapian::WritableDatabase::commit(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_BOOLEAN, Xapian::QueryParser::FLAG_SPELLING_CORRECTION, Xapian::QueryParser::get_corrected_query_string(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_spellpartial1 | ( | ) | [static] |
Definition at line 1930 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_spelling(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_PARTIAL, Xapian::QueryParser::FLAG_SPELLING_CORRECTION, Xapian::QueryParser::get_corrected_query_string(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_spellwild1 | ( | ) | [static] |
Definition at line 1881 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_spelling(), Xapian::DB_CREATE_OR_OVERWRITE, test::expect, Xapian::QueryParser::FLAG_BOOLEAN, Xapian::QueryParser::FLAG_SPELLING_CORRECTION, Xapian::QueryParser::FLAG_WILDCARD, Xapian::QueryParser::get_corrected_query_string(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_stem_all1 | ( | ) | [static] |
Definition at line 2109 of file queryparsertest.cc.
References Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_ALL, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_stoplist1 | ( | ) | [static] |
Definition at line 1749 of file queryparsertest.cc.
References Xapian::QueryParser::parse_query(), Xapian::QueryParser::set_stopper(), Xapian::QueryParser::stoplist_begin(), Xapian::QueryParser::stoplist_end(), TEST, and TEST_EQUAL.
| static bool test_qp_stopper1 | ( | ) | [static] |
Definition at line 1187 of file queryparsertest.cc.
References Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::Query::OP_AND, Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_default_op(), Xapian::QueryParser::set_stopper(), TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_stopword_group1 | ( | ) | [static] |
Definition at line 2404 of file queryparsertest.cc.
References Xapian::SimpleStopper::add(), Xapian::WritableDatabase::add_document(), Xapian::Document::add_term(), test::expect, Xapian::QueryParser::FLAG_WILDCARD, Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::Query::OP_AND, Xapian::Query::OP_OR, Xapian::InMemory::open(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), Xapian::QueryParser::set_default_op(), Xapian::QueryParser::set_stopper(), SKIP_TEST, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_synonym1 | ( | ) | [static] |
Definition at line 1974 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_synonym(), Xapian::WritableDatabase::commit(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_AUTO_SYNONYMS, Xapian::QueryParser::FLAG_DEFAULT, Xapian::Query::get_description(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_synonym2 | ( | ) | [static] |
Definition at line 2016 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_synonym(), Xapian::WritableDatabase::commit(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS, Xapian::QueryParser::FLAG_DEFAULT, Xapian::Query::get_description(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_synonym3 | ( | ) | [static] |
Definition at line 2067 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_synonym(), Xapian::WritableDatabase::commit(), Xapian::DB_CREATE_OR_OVERWRITE, Xapian::QueryParser::FLAG_BOOLEAN, Xapian::QueryParser::FLAG_LOVEHATE, Xapian::QueryParser::FLAG_PHRASE, Xapian::QueryParser::FLAG_SYNONYM, Xapian::Query::get_description(), mkdir(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_database(), Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_unstem_boolean_prefix | ( | ) | [static] |
Definition at line 1260 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::Query::get_description(), Xapian::QueryParser::parse_query(), TEST, TEST_EQUAL, TEST_STRINGS_EQUAL, Xapian::QueryParser::unstem_begin(), and Xapian::QueryParser::unstem_end().
| static bool test_qp_value_customrange1 | ( | ) | [static] |
Definition at line 1721 of file queryparsertest.cc.
References Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_value_daterange1 | ( | ) | [static] |
Definition at line 1591 of file queryparsertest.cc.
References Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_value_daterange2 | ( | ) | [static] |
Definition at line 1633 of file queryparsertest.cc.
References Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_value_range1 | ( | ) | [static] |
Definition at line 1297 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_value_range2 | ( | ) | [static] |
Definition at line 1359 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_value_range3 | ( | ) | [static] |
Definition at line 1397 of file queryparsertest.cc.
References Xapian::WritableDatabase::add_document(), Xapian::Document::add_value(), Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Enquire::get_mset(), Xapian::InMemory::open(), Xapian::QueryParser::parse_query(), query(), Xapian::Enquire::set_query(), Xapian::MSet::size(), SKIP_TEST, Xapian::sortable_serialise(), Xapian::Internal::str(), TEST_EQUAL, and tout.
| static bool test_qp_value_range4 | ( | ) | [static] |
Test a boolean filter which happens to contain "..".
Regression test for bug fixed in 1.2.3.
Also test that the same prefix can be set for a valuerange and filter.
Definition at line 1509 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_qp_value_stringrange1 | ( | ) | [static] |
Definition at line 1672 of file queryparsertest.cc.
References Xapian::QueryParser::add_valuerangeprocessor(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, TEST_STRINGS_EQUAL, and tout.
| static bool test_queryparser1 | ( | ) | [static] |
Definition at line 658 of file queryparsertest.cc.
References Xapian::QueryParser::add_boolean_prefix(), Xapian::QueryParser::add_prefix(), Xapian::Error::get_description(), Xapian::Query::get_description(), Xapian::Error::get_msg(), Xapian::QueryParser::parse_query(), test::query, Xapian::QueryParser::set_stemmer(), Xapian::QueryParser::set_stemming_strategy(), Xapian::QueryParser::STEM_SOME, TEST_EXCEPTION, TEST_STRINGS_EQUAL, and tout.
| static bool test_value_range_serialise1 | ( | ) | [static] |
Definition at line 1541 of file queryparsertest.cc.
References Xapian::sortable_serialise(), Xapian::sortable_unserialise(), Xapian::Internal::str(), TEST_AND_EXPLAIN, TEST_EQUAL, test_value_range_numbers, and tout.
| static double time_query_parse | ( | const Xapian::Database & | db, | |
| const string & | q, | |||
| int | repetitions, | |||
| unsigned | flags | |||
| ) | [static] |
Definition at line 2138 of file queryparsertest.cc.
References CPUTimer::get_time(), Xapian::Query::OP_OR, Xapian::QueryParser::parse_query(), and Xapian::QueryParser::set_database().
Referenced by qp_scale1_helper().
const test test_and_queries[] [static] |
Initial value:
{
{ "internet explorer title:(http www)", "(Zinternet:(pos=1) AND Zexplor:(pos=2) AND ZXThttp:(pos=3) AND ZXTwww:(pos=4))" },
{ "one +two three", "(Zone:(pos=1) AND Ztwo:(pos=2) AND Zthree:(pos=3))" },
{ "hello -title:\"hello world\"", "(Zhello:(pos=1) AND_NOT (XThello:(pos=2) PHRASE 2 XTworld:(pos=3)))" },
{ "\"hello world\" -C++", "((hello:(pos=1) PHRASE 2 world:(pos=2)) AND_NOT c++:(pos=3))" },
{ "-cup site:world", "(0 * Hworld AND_NOT Zcup:(pos=1))" },
{ "site:world -cup", "(0 * Hworld AND_NOT Zcup:(pos=1))" },
{ "(site:world) -cup", "(0 * Hworld AND_NOT Zcup:(pos=1))" },
{ "foo site:xapian.org bar", "((Zfoo:(pos=1) AND Zbar:(pos=2)) FILTER Hxapian.org)" },
{ "a b site:xapian.org", "((Za:(pos=1) AND Zb:(pos=2)) FILTER Hxapian.org)" },
{ "site:xapian.org a b", "((Za:(pos=1) AND Zb:(pos=2)) FILTER Hxapian.org)" },
{ "author:험가 OR subject:万众 hello world!", "((A험:(pos=1) AND A험가:(pos=1) AND A가:(pos=1)) OR (XT万:(pos=2) AND XT万众:(pos=2) AND XT众:(pos=2) AND Zhello:(pos=3) AND Zworld:(pos=4)))" },
{ "洛伊one儿差点two脸three", "(洛:(pos=1) AND 洛伊:(pos=1) AND 伊:(pos=1) AND Zone:(pos=2) AND 儿:(pos=3) AND 儿差:(pos=3) AND 差:(pos=3) AND 差点:(pos=3) AND 点:(pos=3) AND Ztwo:(pos=4) AND 脸:(pos=5) AND Zthree:(pos=6))" },
{ NULL, NULL }
}
Definition at line 703 of file queryparsertest.cc.
const test test_mispelled_partial_queries[] [static] |
Initial value:
{
{ "doucment", "" },
{ "doucment ", "document " },
{ "documen", "" },
{ "documen ", "document " },
{ "seearch documen", "search documen" },
{ "search documen", "" },
{ NULL, NULL }
}
Definition at line 1918 of file queryparsertest.cc.
const test test_mispelled_queries[] [static] |
Initial value:
{
{ "doucment search", "document search" },
{ "doucment seeacrh", "document search" },
{ "docment seeacrh test", "document search test" },
{ "\"paragahp pineapple\"", "\"paragraph pineapple\"" },
{ "\"paragahp pineapple\"", "\"paragraph pineapple\"" },
{ "test S.E.A.R.C.", "" },
{ "this AND that", "" },
{ "documento", "document" },
{ "documento-documento", "document-document" },
{ "documento-searcho", "document-search" },
{ "test saerch", "test search" },
{ "paragraf search", "paragraph search" },
{ NULL, NULL }
}
Definition at line 1781 of file queryparsertest.cc.
const test test_mispelled_wildcard_queries[] [static] |
Initial value:
{
{ "doucment", "document" },
{ "doucment*", "" },
{ "doucment* seearch", "doucment* search" },
{ "doucment* search", "" },
{ NULL, NULL }
}
Definition at line 1871 of file queryparsertest.cc.
const test test_multi_synonym_queries[] [static] |
Initial value:
{
{ "sun OR tan OR cream", "(Zsun:(pos=1) OR Ztan:(pos=2) OR Zcream:(pos=3))" },
{ "sun tan", "((Zsun:(pos=1) OR Ztan:(pos=2)) SYNONYM bathe:(pos=1))" },
{ "sun tan cream", "((Zsun:(pos=1) OR Ztan:(pos=2) OR Zcream:(pos=3)) SYNONYM lotion:(pos=1))" },
{ "beach sun tan holiday", "(Zbeach:(pos=1) OR ((Zsun:(pos=2) OR Ztan:(pos=3)) SYNONYM bathe:(pos=2)) OR Zholiday:(pos=4))" },
{ "sun tan sun tan cream", "(((Zsun:(pos=1) OR Ztan:(pos=2)) SYNONYM bathe:(pos=1)) OR ((Zsun:(pos=3) OR Ztan:(pos=4) OR Zcream:(pos=5)) SYNONYM lotion:(pos=3)))" },
{ "single", "(Zsingl:(pos=1) SYNONYM record:(pos=1))" },
{ NULL, NULL }
}
Definition at line 2005 of file queryparsertest.cc.
const test test_near_queries[] [static] |
Definition at line 2231 of file queryparsertest.cc.
const test test_or_queries[] [static] |
Definition at line 51 of file queryparsertest.cc.
const test test_phrase_queries[] [static] |
Definition at line 2303 of file queryparsertest.cc.
const test test_pure_not_queries[] [static] |
Initial value:
{
{ "NOT windows", "(<alldocuments> AND_NOT Zwindow:(pos=1))" },
{ "a AND (NOT b)", "(Za:(pos=1) AND (<alldocuments> AND_NOT Zb:(pos=2)))" },
{ "AND NOT windows", "Syntax: <expression> AND NOT <expression>" },
{ "gordian NOT", "Syntax: <expression> NOT <expression>" },
{ "gordian AND NOT", "Syntax: <expression> AND NOT <expression>" },
{ NULL, NULL }
}
Definition at line 1217 of file queryparsertest.cc.
const test test_stem_all_queries[] [static] |
Initial value:
{
{ "\"chemical engineers\"", "(chemic:(pos=1) PHRASE 2 engin:(pos=2))" },
{ "chemical NEAR engineers", "(chemic:(pos=1) NEAR 11 engin:(pos=2))" },
{ "chemical engineers", "(chemic:(pos=1) OR engin:(pos=2))" },
{ NULL, NULL }
}
Definition at line 2102 of file queryparsertest.cc.
const test test_stop_queries[] [static] |
Initial value:
{
{ "test the queryparser", "(test:(pos=1) AND queryparser:(pos=3))" },
{ "test AND the AND queryparser", "(test:(pos=1) AND the:(pos=2) AND queryparser:(pos=3))" },
{ "the", "the:(pos=1)" },
{ "an the a", "(an:(pos=1) AND the:(pos=2) AND a:(pos=3))" },
{ "the AND a an", "(the:(pos=1) AND a:(pos=2) AND an:(pos=3))" },
{ NULL, NULL }
}
Definition at line 1168 of file queryparsertest.cc.
const test test_stopword_group_and_queries[] [static] |
Initial value:
{
{ "this is a test", "test:(pos=4)" },
{ "test*", "(test:(pos=1) SYNONYM testable:(pos=1) SYNONYM tester:(pos=1))" },
{ "a test*", "(test:(pos=2) SYNONYM testable:(pos=2) SYNONYM tester:(pos=2))" },
{ "is a test*", "(test:(pos=3) SYNONYM testable:(pos=3) SYNONYM tester:(pos=3))" },
{ "this is a test*", "(test:(pos=4) SYNONYM testable:(pos=4) SYNONYM tester:(pos=4))" },
{ "this is a us* test*", "(user:(pos=4) AND (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
{ "this is a user test*", "(user:(pos=4) AND (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
{ NULL, NULL }
}
Definition at line 2389 of file queryparsertest.cc.
const test test_stopword_group_or_queries[] [static] |
Initial value:
{
{ "this is a test", "test:(pos=4)" },
{ "test*", "(test:(pos=1) SYNONYM testable:(pos=1) SYNONYM tester:(pos=1))" },
{ "a test*", "(test:(pos=2) SYNONYM testable:(pos=2) SYNONYM tester:(pos=2))" },
{ "is a test*", "(test:(pos=3) SYNONYM testable:(pos=3) SYNONYM tester:(pos=3))" },
{ "this is a test*", "(test:(pos=4) SYNONYM testable:(pos=4) SYNONYM tester:(pos=4))" },
{ "this is a us* test*", "(user:(pos=4) OR (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
{ "this is a user test*", "(user:(pos=4) OR (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
{ NULL, NULL }
}
Definition at line 2378 of file queryparsertest.cc.
const test test_synonym_op_queries[] [static] |
Initial value:
{
{ "searching", "Zsearch:(pos=1)" },
{ "~searching", "(Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1))" },
{ "~search", "(Zsearch:(pos=1) SYNONYM find:(pos=1))" },
{ "~Search", "(search:(pos=1) SYNONYM find:(pos=1))" },
{ "~Searching", "searching:(pos=1)" },
{ "~searching OR terms", "((Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1)) OR Zterm:(pos=2))" },
{ "~search OR terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
{ "~search +terms", "(Zterm:(pos=2) AND_MAYBE (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
{ "~search -terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_NOT Zterm:(pos=2))" },
{ "+~search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_MAYBE Zterm:(pos=2))" },
{ "-~search terms", "(Zterm:(pos=2) AND_NOT (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
{ "~search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
{ "~\"search terms\"", "(search:(pos=1) PHRASE 2 terms:(pos=2))" },
{ NULL, NULL }
}
Definition at line 2048 of file queryparsertest.cc.
const test test_synonym_queries[] [static] |
Initial value:
{
{ "searching", "(Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1))" },
{ "search", "(Zsearch:(pos=1) SYNONYM find:(pos=1))" },
{ "Search", "(search:(pos=1) SYNONYM find:(pos=1))" },
{ "Searching", "searching:(pos=1)" },
{ "searching OR terms", "((Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1)) OR Zterm:(pos=2))" },
{ "search OR terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
{ "search +terms", "(Zterm:(pos=2) AND_MAYBE (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
{ "search -terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_NOT Zterm:(pos=2))" },
{ "+search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_MAYBE Zterm:(pos=2))" },
{ "-search terms", "(Zterm:(pos=2) AND_NOT (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
{ "search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
{ "\"search terms\"", "(search:(pos=1) PHRASE 2 terms:(pos=2))" },
{ NULL, NULL }
}
Definition at line 1956 of file queryparsertest.cc.
const test test_value_customrange1_queries[] [static] |
Initial value:
{
{ "mars author:Asimov..Bradbury", "(mars:(pos=1) FILTER VALUE_RANGE 4 asimov bradbury)" },
{ NULL, NULL }
}
Definition at line 1715 of file queryparsertest.cc.
const test test_value_daterange1_queries[] [static] |
Initial value:
{
{ "12/03/99..12/04/01", "VALUE_RANGE 1 19991203 20011204" },
{ "03-12-99..04-14-01", "VALUE_RANGE 1 19990312 20010414" },
{ "01/30/60..02/02/59", "VALUE_RANGE 1 19600130 20590202" },
{ "1999-03-12..2001-04-14", "VALUE_RANGE 1 19990312 20010414" },
{ "12/03/99..02", "Unknown range operation" },
{ "1999-03-12..2001", "Unknown range operation" },
{ NULL, NULL }
}
Definition at line 1580 of file queryparsertest.cc.
const test test_value_daterange2_queries[] [static] |
Initial value:
{
{ "created:12/03/99..12/04/01", "VALUE_RANGE 1 19991203 20011204" },
{ "modified:03-12-99..04-14-01", "VALUE_RANGE 2 19990312 20010414" },
{ "accessed:01/30/70..02/02/69", "VALUE_RANGE 3 19700130 20690202" },
{ "1999-03-12..2001-04-14", "Unknown range operation" },
{ "12/03/99..created:12/04/01", "Unknown range operation" },
{ "12/03/99created:..12/04/01", "Unknown range operation" },
{ "12/03/99..12/04/01created:", "Unknown range operation" },
{ "12/03/99..02", "Unknown range operation" },
{ "1999-03-12..2001", "Unknown range operation" },
{ NULL, NULL }
}
Definition at line 1619 of file queryparsertest.cc.
const test test_value_range1_queries[] [static] |
Initial value:
{
{ "a..b", "VALUE_RANGE 1 a b" },
{ "$50..100", "VALUE_RANGE 1 $50 100" },
{ "$50..$100", "VALUE_RANGE 1 $50 $100" },
{ "02/03/1979..10/12/1980", "VALUE_RANGE 1 02/03/1979 10/12/1980" },
{ "a..b hello", "(hello:(pos=1) FILTER VALUE_RANGE 1 a b)" },
{ "hello a..b", "(hello:(pos=1) FILTER VALUE_RANGE 1 a b)" },
{ "hello a..b world", "((hello:(pos=1) OR world:(pos=2)) FILTER VALUE_RANGE 1 a b)" },
{ "hello a..b test:foo", "(hello:(pos=1) FILTER (VALUE_RANGE 1 a b AND XTESTfoo))" },
{ "hello a..b test:foo test:bar", "(hello:(pos=1) FILTER (VALUE_RANGE 1 a b AND (XTESTfoo OR XTESTbar)))" },
{ "hello a..b c..d test:foo", "(hello:(pos=1) FILTER ((VALUE_RANGE 1 a b OR VALUE_RANGE 1 c d) AND XTESTfoo))" },
{ "hello a..b c..d test:foo test:bar", "(hello:(pos=1) FILTER ((VALUE_RANGE 1 a b OR VALUE_RANGE 1 c d) AND (XTESTfoo OR XTESTbar)))" },
{ "-5..7", "VALUE_RANGE 1 -5 7" },
{ "hello -5..7", "(hello:(pos=1) FILTER VALUE_RANGE 1 -5 7)" },
{ "-5..7 hello", "(hello:(pos=1) FILTER VALUE_RANGE 1 -5 7)" },
{ "\"time flies\" 09:00..12:30", "((time:(pos=1) PHRASE 2 flies:(pos=2)) FILTER VALUE_RANGE 1 09:00 12:30)" },
{ "..b", "VALUE_RANGE 1 b" },
{ "a..", "VALUE_GE 1 a" },
{ NULL, NULL }
}
Definition at line 1274 of file queryparsertest.cc.
const test test_value_range2_queries[] [static] |
Definition at line 1326 of file queryparsertest.cc.
const test test_value_range4_queries[] [static] |
Initial value:
{
{ "id:19254@foo..example.com", "0 * Q19254@foo..example.com" },
{ "hello:world", "0 * XHELLOworld" },
{ "hello:mum..world", "VALUE_RANGE 1 mum world" },
{ NULL, NULL }
}
Definition at line 1496 of file queryparsertest.cc.
const double test_value_range_numbers[] [static] |
const test test_value_stringrange1_queries[] [static] |
Initial value:
{
{ "tag:bar..foo", "VALUE_RANGE 1 bar foo" },
{ "bar..foo", "VALUE_RANGE 0 bar foo" },
{ NULL, NULL }
}
Definition at line 1665 of file queryparsertest.cc.