46 vector<Xapian::Query> subqs;
150 mset_expect_order(mymset, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
161 mset_expect_order(mymset, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
173 mset_expect_order(mymset, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
185 vector<Xapian::Query> subqs;
235 vector<Xapian::Query> subqs;
422 vector<Xapian::Query> subqs;
DEFINE_TESTCASE(near1, positional)
Simple test of NEAR.
Xapian::WritableDatabase get_writable_database(const string &dbname)
Xapian::Database get_database(const string &dbname)
test functionality of the Xapian API
Class implementing a "boolean" weighting scheme.
An indexed database of documents.
PositionIterator positionlist_end(Xapian::docid, std::string_view) const noexcept
End iterator corresponding to positionlist_begin().
TermIterator termlist_begin(Xapian::docid did) const
Start iterating the terms in a document.
PositionIterator positionlist_begin(Xapian::docid did, std::string_view term) const
Start iterating positions for a term in a document.
bool term_exists(std::string_view term) const
Test is a particular term is present in any document.
TermIterator termlist_end(Xapian::docid) const noexcept
End iterator corresponding to termlist_begin().
Xapian::Document get_document(Xapian::docid did, unsigned flags=0) const
Get a document from the database.
Class representing a document.
void add_term(std::string_view term, Xapian::termcount wdf_inc=1)
Add a term to this document.
void remove_posting(std::string_view term, Xapian::termpos term_pos, Xapian::termcount wdf_dec=1)
Remove posting for a term.
TermIterator termlist_begin() const
Start iterating the terms in this document.
void add_posting(std::string_view term, Xapian::termpos term_pos, Xapian::termcount wdf_inc=1)
Add a posting for a term.
void set_weighting_scheme(const Weight &weight)
Set the weighting scheme to use.
MSet get_mset(doccount first, doccount maxitems, doccount checkatleast=0, const RSet *rset=NULL, const MatchDecider *mdecider=NULL) const
Run the query.
void set_query(const Query &query, termcount query_length=0)
Set the query.
Class representing a list of search results.
Class for iterating over term positions.
void skip_to(Xapian::termpos termpos)
Advance the iterator to term position termpos.
Class representing a query.
@ OP_NEAR
Match only documents where all subqueries match near each other.
@ OP_AND
Match only documents which all subqueries match.
@ OP_PHRASE
Match only documents where all subqueries match near and in order.
Class representing a stemming algorithm.
Class for iterating over a list of terms.
void skip_to(std::string_view term)
Advance the iterator to term term.
PositionIterator positionlist_end() const noexcept
Return an end PositionIterator for the current term.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
PositionIterator positionlist_begin() const
Return a PositionIterator for the current term.
UnimplementedError indicates an attempt to use an unimplemented feature.
This class provides read/write access to a database.
void delete_document(Xapian::docid did)
Delete a document from the database.
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a document in the database.
Xapian::docid add_document(const Xapian::Document &doc)
Add a document to the database.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
static Xapian::Stem stemmer
a generic test suite engine
#define TEST_EQUAL(a, b)
Test for equality of two things.
#define TEST(a)
Test a condition, without an additional explanation for failure.
#define TEST_NOT_EQUAL(a, b)
Test for non-equality of two things.
void mset_expect_order(const Xapian::MSet &A, Xapian::docid d1, Xapian::docid d2, Xapian::docid d3, Xapian::docid d4, Xapian::docid d5, Xapian::docid d6, Xapian::docid d7, Xapian::docid d8, Xapian::docid d9, Xapian::docid d10, Xapian::docid d11, Xapian::docid d12)
Xapian-specific test helper functions and macros.
#define TEST_EXCEPTION(TYPE, CODE)
Check that CODE throws exactly Xapian exception TYPE.
Public interfaces for the Xapian library.