Public interfaces for the Xapian library.
More...
Public interfaces for the Xapian library.
const FieldProcessor * release() const
Start reference counting this object.
Definition: queryparser.h:763
void need_stat(stat_flags flag)
Tell Xapian that your subclass will want a particular statistic.
Definition: weight.h:83
virtual std::string get_description() const
Return a string describing this object.
ExpandDeciderFilterPrefix(const std::string &prefix_)
The parameter specify the prefix of terms to be retained.
Definition: expanddecider.h:150
~TermIterator()
Destructor.
Definition: termiterator.h:84
FixedWeightPostingSource * unserialise(const std::string &serialised) const
Create object given string serialisation returned by serialise().
Xapian::termcount get_query_length() const
The length of the query.
Definition: weight.h:359
void unserialise(const std::string &serialised)
Unserialise a string and set this object to the coordinates in it.
const int DB_RETRY_LOCK
If the database is already locked, retry the lock.
Definition: constants.h:145
Registry for user subclasses.
Definition: registry.h:47
InvalidArgumentError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:257
void compact()
Perform the actual compaction/merging operation.
void increase_termpos(Xapian::termpos delta=100)
Increase the term position used by index_text.
void set_sort_by_relevance()
Set the sorting to be by relevance only.
void set_docid_order(docid_order order)
Set sort order for document IDs.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
virtual std::string serialise_results() const
Serialise the results of this match spy.
@ NON_SPACING_MARK
Mark, nonspacing (Mn)
Definition: unicode.h:227
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
DerefWrapper_< std::string > operator++(int)
Advance the iterator to the next position (postfix version).
Definition: valueiterator.h:96
DatabaseModifiedError indicates a database was modified.
Definition: error.h:539
ESetIterator operator[](Xapian::doccount i) const
Return iterator pointing to the i-th object in this ESet.
Definition: eset.h:357
void register_posting_source(const Xapian::PostingSource &source)
Register a user-defined posting source class.
Abstract base class for match spies.
Definition: matchspy.h:50
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
Xapian::doccount get_termfreq_est() const
An estimate of the number of documents this object can return.
TermIterator allterms_end(const std::string &=std::string()) const
Corresponding end iterator to allterms_begin(prefix).
Definition: database.h:265
std::string get_description() const
Return a string describing this object.
void keep_alive()
Send a "keep-alive" to remote databases to stop them timing out.
std::string serialise() const
Return this object's parameters serialised as a single string.
Enquire(const Database &database, ErrorHandler *errorhandler_)
Create a Xapian::Enquire object.
@ INITIAL_QUOTE_PUNCTUATION
Punctuation, initial quote (Pi)
Definition: unicode.h:244
PositionIterator positionlist_begin() const
Return a PositionIterator for the current document.
std::string get_description() const
Return a string describing this object.
void set_default_op(Query::op default_op)
Set the default operator.
const valueno BAD_VALUENO
Reserved value to indicate "no valueno".
Definition: types.h:125
virtual PostingSource * clone() const
Clone the posting source.
flags set_flags(flags toggle, flags mask=flags(0))
Set flags.
DerefWrapper_< std::string > operator++(int)
Advance the iterator to the next position (postfix version).
Definition: termiterator.h:112
void operator=(const Database &other)
Assignment is allowed.
const Xapian::PostingSource * get_posting_source(const std::string &name) const
Get a posting source given a name.
bool prefix
Whether to look for str as a prefix or suffix.
Definition: queryparser.h:464
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
const Query operator|=(const Query &o)
Combine with another Xapian::Query object using OP_OR.
Definition: query.h:802
Xapian::TermIterator spellings_begin() const
An iterator which returns all the spelling correction targets.
TfIdfWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
DatabaseLockError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:509
void set_sort_by_value(Xapian::valueno sort_key, bool reverse)
Set the sorting to be by value only.
@ TITLECASE_LETTER
Letter, titlecase (Lt)
Definition: unicode.h:224
ValueCountMatchSpy(Xapian::valueno slot_)
Construct a MatchSpy which counts the values in a particular slot.
Definition: matchspy.h:237
std::string serialise() const
Return this object's parameters serialised as a single string.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
A latitude-longitude coordinate.
Definition: geospatial.h:81
double get_weight() const
Return the weight contribution for the current document.
~QueryParser()
Destructor.
void operator()(Xapian::Error &error)
Handle a Xapian::Error object.
TermIterator get_matching_terms_end(Xapian::docid) const
End iterator corresponding to get_matching_terms_begin()
Definition: enquire.h:713
virtual LatLongMetric * clone() const =0
Clone the metric.
@ MATH_SYMBOL
Symbol, math (Sm)
Definition: unicode.h:247
This class implements the BB2 weighting scheme.
Definition: weight.h:1032
Handle a date range.
Definition: queryparser.h:512
RangeError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:995
std::string get_value_upper_bound(Xapian::valueno slot) const
Get an upper bound on the values stored in the given value slot.
void set_cutoff(int percent_cutoff, double weight_cutoff=0)
Set the percentage and/or weight cutoffs.
NetworkError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:819
@ OTHER_PUNCTUATION
Punctuation, other (Po)
Definition: unicode.h:246
void set_data(const std::string &data)
Set data stored in the document.
Weight()
Default constructor, needed by subclass constructors.
Definition: weight.h:141
DatabaseVersionError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:648
double get_weight() const
Return the weight contribution for the current document.
std::string get_description() const
Return a string describing this object.
@ FINAL_QUOTE_PUNCTUATION
Punctuation, final quote (Pf)
Definition: unicode.h:245
category get_category(unsigned ch)
Return the category which a given Unicode character falls into.
Definition: unicode.h:338
virtual PostingSource * unserialise_with_registry(const std::string &serialised, const Registry ®istry) const
Create object given string serialisation returned by serialise().
virtual ~StemImplementation()
Virtual destructor.
const int DBCOMPACT_SINGLE_FILE
Produce a single-file database.
Definition: constants.h:268
@ SURROGATE
Other, surrogate (Cs)
Definition: unicode.h:239
TermIterator unstem_begin(const std::string &term) const
Begin iterator over unstemmed forms of the given stemmed query term.
virtual ~ValueRangeProcessor()
Destructor.
MSetIterator()
Create an unpositioned MSetIterator.
Definition: mset.h:369
virtual void operator()(const Xapian::Document &doc, double wt)=0
Register a document with the match spy.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void set_expansion_scheme(const std::string &eweightname_, double expand_k_=1.0) const
Set the weighting scheme to use for expansion.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
void clear_terms()
Remove all terms (and postings) from the document.
~ValueIterator()
Destructor.
Definition: valueiterator.h:85
Xapian::TermIterator synonyms_end(const std::string &) const
Corresponding end iterator to synonyms_begin(term).
Definition: database.h:443
std::string serialise() const
Return this object's parameters serialised as a single string.
MSetIterator operator[](Xapian::doccount i) const
Return iterator pointing to the i-th object in this MSet.
Definition: mset.h:619
RSet(const RSet &rset)
Copy constructor.
Stopper()
Default constructor.
Definition: queryparser.h:56
bool operator<(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
Definition: eset.h:297
WildcardError indicates an error expanding a wildcarded query.
Definition: error.h:1013
std::string serialise() const
Serialise document into a string.
std::string get_description() const
Return a string describing this object.
void add_boolean_prefix(const std::string &field, const std::string &prefix, const std::string *grouping=NULL)
Add a boolean term prefix allowing the user to restrict a search with a boolean filter specified in t...
ESet get_eset(Xapian::termcount maxitems, const RSet &omrset, const Xapian::ExpandDecider *edecider) const
Get the expand set for the given rset.
Definition: enquire.h:643
void set_sort_by_value_then_relevance(Xapian::valueno sort_key, bool reverse)
Set the sorting to be by value, then by relevance for documents with the same value.
Xapian::totallength get_total_length() const
Get the total length of all the documents in the database.
LatLongCoord()
Construct an uninitialised coordinate.
Definition: geospatial.h:102
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqueterms) const
Calculate the weight contribution for this object's term to a document.
void fetch() const
Prefetch hint the whole MSet.
Definition: mset.h:277
void set_stopper(const Stopper *stop=NULL)
Set the stopper.
virtual double get_weight() const
Return the weight contribution for the current document.
std::string get_description() const
Return a string describing this object.
double longitude
A longitude, as decimal degrees.
Definition: geospatial.h:98
double miles_to_metres(double miles)
Convert from miles to metres.
Definition: geospatial.h:54
ExpandDeciderAnd(const ExpandDecider &first_, const ExpandDecider &second_)
Terms will be checked with first, and if accepted, then checked with second.
Definition: expanddecider.h:98
PostingIterator postlist_end(const std::string &) const
Corresponding end iterator to postlist_begin().
Definition: database.h:225
LatLongCoordsIterator()
Default constructor. Produces an uninitialised iterator.
Definition: geospatial.h:178
DatabaseCreateError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:467
const char * version_string()
Report the version string of the library which the program is linked with.
Definition: xapian.h:115
TermIterator(const TermIterator &o)
Copy constructor.
unsigned flags
Flags.
Definition: queryparser.h:161
Xapian::doccount get_termfreq_est() const
An estimate of the number of documents this object can return.
std::string name() const
Return the name of this weighting scheme.
const Xapian::Document & get_document() const
Get the current document.
TermIterator unstem_end(const std::string &) const
End iterator over unstemmed forms of the given stemmed query term.
Definition: queryparser.h:1218
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
Xapian::Weight subclass implementing the traditional probabilistic formula.
Definition: weight.h:746
ErrorHandler()
Default constructor.
Definition: errorhandler.h:81
void add_value(Xapian::valueno slot, bool reverse=false, const std::string &defvalue=std::string())
Add a value slot to the list to build a key from.
Definition: keymaker.h:143
Xapian::valueno get_valueno() const
Return the value slot number for the current position.
PostingIterator(const PostingIterator &o)
Copy constructor.
Document()
Make a new empty Document.
std::string get_uuid() const
Get a UUID for the database.
const int DB_CREATE_OR_OVERWRITE
Create database if it doesn't already exist, or overwrite if it does.
Definition: constants.h:38
virtual ~MatchDecider()
Destructor.
unsigned timeout
A timeout value in milliseconds.
Definition: types.h:100
Build key strings for MSet ordering or collapsing.
std::string get_description() const
Return a string describing this object.
Utf8Iterator()
Create an iterator which is at the end of its iteration.
Definition: unicode.h:132
void skip_to(Xapian::docid docid_or_slot)
Advance the iterator to document id or value slot docid_or_slot.
double get_sumextra(Xapian::termcount, Xapian::termcount) const
Calculate the term-independent weight component for a document.
void unserialise(const std::string &serialised)
Unserialise a string and set this object to its coordinate.
bool operator()(const Xapian::Document &doc) const
Decide whether we want a particular document to be in the MSet.
void operator=(const Document &other)
Assignment is allowed.
std::string str
The prefix (or suffix with RP_SUFFIX) string to look for.
Definition: queryparser.h:148
std::string serialise() const
Return this object's parameters serialised as a single string.
Registry & operator=(const Registry &other)
Assignment operator.
NumberValueRangeProcessor(Xapian::valueno slot_, const std::string &str_, bool prefix_=true)
Constructor.
Definition: queryparser.h:695
const RangeProcessor * release() const
Start reference counting this object.
Definition: queryparser.h:235
TermIterator termlist_begin() const
Iterator for the terms in this document.
ExpandDecider()
Default constructor.
Definition: expanddecider.h:47
Class for iterating over document values.
Xapian::doccount get_termfreq(const std::string &tname) const
Get the number of documents in the database indexed by a given term.
TermGenerator(const TermGenerator &o)
Copy constructor.
Xapian::Document get_document(Xapian::docid did, unsigned flags) const
Get a document from the database, given its document id.
const LatLongCoord & operator*() const
Get the LatLongCoord for the current position.
Definition: geospatial.h:181
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Definition: types.h:133
void init(double factor_)
Allow the subclass to perform any initialisation it needs to.
std::input_iterator_tag iterator_category
We implement the semantics of an STL input_iterator.
Definition: unicode.h:204
unsigned to_utf8(unsigned ch, char *buf)
Convert a single Unicode character to UTF-8.
Definition: unicode.h:321
parsing a user query string to build a Xapian::Query object
void begin_transaction(bool flushed=true)
Begin a transaction.
const KeyMaker * release() const
Start reference counting this object.
Definition: keymaker.h:83
virtual void merge_results(const std::string &serialised)
Unserialise some results, and merge them into this matchspy.
virtual std::string name() const
Return the name of this match spy.
ValueWeightPostingSource * unserialise(const std::string &serialised) const
Create object given string serialisation returned by serialise().
double weight
The weight of a document or term.
Definition: types.h:122
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
Factory functions for constructing Database and WritableDatabase objects.
MSet()
Default constructor.
NetworkTimeoutError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:861
void set_stopper(const Xapian::Stopper *stop=NULL)
Set the Xapian::Stopper object to be used for identifying stopwords.
DatabaseCreateError indicates a failure to create a database.
Definition: error.h:451
@ WILDCARD_LIMIT_FIRST
Stop expanding when OP_WILDCARD reaches its expansion limit.
Definition: query.h:288
stem_strategy
Stemming strategies, for use with set_stemming_strategy().
Definition: queryparser.h:891
A posting source which generates weights from a value slot.
Definition: postingsource.h:401
const int DB_FULL_SYNC
Try to ensure changes are really written to disk.
Definition: constants.h:83
API for working with documents.
bool empty() const
Return true if this ESet object is empty.
Definition: eset.h:85
Xapian::Document get_document(Xapian::docid did) const
Get a document from the database, given its document id.
Query(Query::op op_)
Construct with just an operator.
Definition: query.h:598
A posting source which reads weights from a value slot.
Definition: postingsource.h:587
TermIterator & operator=(const TermIterator &o)
Assignment.
virtual std::string name() const
Return the name of this match spy.
@ OPEN_PUNCTUATION
Punctuation, open (Ps)
Definition: unicode.h:242
double curr_weight
Weight at current position.
Definition: postingsource.h:641
GreatCircleMetric(double radius_)
Construct a GreatCircleMetric using a specified radius.
std::string get_metadata(const std::string &key) const
Get the user-specified metadata associated with a given key.
docid get_docid() const
Get the document id which is associated with this document (if any).
const Xapian::MatchSpy * get_match_spy(const std::string &name) const
Get a match spy given a name.
int get_percent() const
Convert the weight of the current iterator position to a percentage.
Definition: mset.h:514
MSet get_mset(Xapian::doccount first, Xapian::doccount maxitems, Xapian::doccount checkatleast=0, const RSet *omrset=0, const MatchDecider *mdecider=0) const
Get (a portion of) the match set for the current query.
Utf8Iterator(const char *p_, size_t len)
Create an iterator given a pointer and a length.
Definition: unicode.h:114
#define XAPIAN_DOCID_BASE_TYPE
Base (signed) type for Xapian::docid and related types.
Definition: version.h:71
virtual Xapian::doccount get_termfreq_est() const =0
An estimate of the number of documents this object can return.
unsigned toupper(unsigned ch)
Convert a Unicode character to uppercase.
Definition: unicode.h:384
void set_stemmer(const Xapian::Stem &stemmer)
Set the Xapian::Stem object to be used for generating stemmed terms.
Xapian::termcount get_doclength_upper_bound() const
Get an upper bound on the length of a document in this DB.
Indicates an attempt to access a document not present in the database.
Definition: error.h:674
int minor_version()
Report the minor version of the library which the program is linked with.
Definition: xapian.h:133
Class implementing a "boolean" weighting scheme.
Definition: weight.h:400
Xapian::valueno valno
The value slot to process.
Definition: queryparser.h:461
Xapian::Query operator()(const std::string &begin, const std::string &end)
Check for a valid date range.
std::string get_collapse_key() const
Return the collapse key for the current position.
Xapian::TermIterator metadata_keys_end(const std::string &=std::string()) const
Corresponding end iterator to metadata_keys_begin().
Definition: database.h:506
void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
bool items_at_end
Flag, set to true if there are docs after the end of the range.
Definition: postingsource.h:644
Xapian::doccount size() const
Return number of items in this MSet object.
void register_lat_long_metric(const Xapian::LatLongMetric &metric)
Register a user-defined lat-long metric class.
@ PARAGRAPH_SEPARATOR
Separator, paragraph (Zp)
Definition: unicode.h:235
MSetIterator begin() const
Return iterator pointing to the first item in this MSet.
Definition: mset.h:607
std::string serialise() const
Return this object's parameters serialised as a single string.
std::string get_description() const
Return a string describing this object.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Definition: types.h:72
void next(double min_wt)
Advance the current position to the next matching document.
ValueMapPostingSource * clone() const
Clone the posting source.
Utf8Iterator(const std::string &s)
Create an iterator given a string.
Definition: unicode.h:125
virtual void init(double factor)=0
Allow the subclass to perform any initialisation it needs to.
DatabaseOpeningError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:605
void assign(const char *p_, size_t len)
Assign a new string to the iterator.
Definition: unicode.h:72
Class for iterating over term positions.
Definition: positioniterator.h:40
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
LatLongCoords(const LatLongCoord &coord)
Construct a container holding one coordinate.
Definition: geospatial.h:269
double get_weight() const
Get the weight for the current position.
MSetIterator operator++(int)
Advance the iterator to the next position (postfix version).
Definition: mset.h:381
IneB2Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
virtual PostingSource * unserialise(const std::string &serialised) const
Create object given string serialisation returned by serialise().
bool operator>=(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
Definition: eset.h:317
PositionIterator positionlist_end(Xapian::docid, const std::string &) const
Corresponding end iterator to positionlist_begin().
Definition: database.h:252
op
Query operators.
Definition: query.h:78
std::string serialise() const
Return a serialised representation of the coordinate.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
DatabaseVersionError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:656
LatLongCoordsIterator begin() const
Get a begin iterator for the coordinates.
Definition: geospatial.h:238
Xapian::totallength get_total_length() const
Total length of all documents in the collection.
Definition: weight.h:391
difference_type operator-(const MSetIterator &o) const
Return the number of positions between o and this iterator.
Definition: mset.h:452
virtual double get_maxextra() const =0
Return an upper bound on what get_sumextra() can return for any document.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
void append(const LatLongCoord &coord)
Append a coordinate to the end of the sequence.
Definition: geospatial.h:260
This class implements the IfB2 weighting scheme.
Definition: weight.h:887
Xapian::termcount get_doclength() const
Return the length of the document at the current position.
ESetIterator & operator-=(difference_type n)
Move the iterator back by n positions.
Definition: eset.h:239
const int DOC_ASSUME_VALID
Assume document id is valid.
Definition: constants.h:280
Xapian::Weight subclass implementing Coordinate Matching.
Definition: weight.h:1487
TermGenerator & operator=(const TermGenerator &o)
Assignment.
PostingSource()
Allow subclasses to be instantiated.
Definition: postingsource.h:67
Xapian::termpos remove_postings(const std::string &term, Xapian::termpos term_pos_first, Xapian::termpos term_pos_last, Xapian::termcount wdf_dec=1)
Remove a range of postings for a term.
LatLongMetric * unserialise(const std::string &serialised) const
Create object given string serialisation returned by serialise().
Build a Xapian::Query object from a user query string.
Definition: queryparser.h:770
Xapian::doccount get_rank() const
Return the MSet rank for the current position.
Definition: mset.h:460
void set_maxweight(double max_weight)
Specify an upper bound on what get_weight() will return from now on.
void flush()
Pre-1.1.0 name for commit().
Definition: database.h:925
void register_match_spy(const Xapian::MatchSpy &spy)
Register a user-defined match spy class.
static size_t check(const std::string &path, int opts=0, std::ostream *out=NULL)
Check the integrity of a database or database table.
Definition: database.h:560
static size_t check(int fd, int opts=0, std::ostream *out=NULL)
Check the integrity of a single file database.
Definition: database.h:575
double get_sumextra(Xapian::termcount doclen, Xapian::termcount) const
Calculate the term-independent weight component for a document.
@ CONNECTOR_PUNCTUATION
Punctuation, connector (Pc)
Definition: unicode.h:240
@ CLOSE_PUNCTUATION
Punctuation, close (Pe)
Definition: unicode.h:243
std::string name() const
Return the name of this weighting scheme.
Stem(StemImplementation *p)
Construct a Xapian::Stem object with a user-provided stemming algorithm.
LatLongCoordsIterator & operator++()
Advance the iterator to the next position.
Definition: geospatial.h:186
This class implements the DLH weighting scheme, which is a representative scheme of the Divergence fr...
Definition: weight.h:1108
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
@ OP_OR
Match documents which at least one subquery matches.
Definition: query.h:92
SimpleStopper()
Default constructor.
Definition: queryparser.h:101
ValueMapPostingSource * unserialise(const std::string &serialised) const
Create object given string serialisation returned by serialise().
CoordWeight()
Construct a CoordWeight.
Definition: weight.h:1497
@ MODIFIER_LETTER
Letter, modifier (Lm)
Definition: unicode.h:225
TermIterator termlist_begin(Xapian::docid did) const
An iterator pointing to the start of the termlist for a given document.
const int DB_CREATE
Create a new database.
Definition: constants.h:44
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
ValueIterator valuestream_end(Xapian::valueno) const
Return end iterator corresponding to valuestream_begin().
Definition: database.h:359
const Query operator/=(double factor)
Inverse scale using OP_SCALE_WEIGHT.
Definition: query.h:587
Registry()
Default constructor.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
Allow rejection of terms during ESet generation.
std::string serialise() const
Return this object's parameters serialised as a single string.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
Xapian::termpos operator*() const
Return the term position at the current iterator position.
double operator()(const LatLongCoords &a, const LatLongCoords &b) const
Return the distance between two coordinate lists, in metres.
TermIterator get_matching_terms_end(const MSetIterator &) const
End iterator corresponding to get_matching_terms_begin()
Definition: enquire.h:742
Xapian::doccount get_collection_size() const
The number of documents in the collection.
Definition: weight.h:341
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
InvalidArgumentError indicates an invalid parameter value was passed to the API.
Definition: error.h:241
Query(const std::string &term, Xapian::termcount wqf=1, Xapian::termpos pos=0)
Construct a Query object for a term.
void set_termpos(Xapian::termpos termpos)
Set the current term position.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Xapian::doccount get_termfreq_max() const
An upper bound on the number of documents this object can return.
std::string serialise() const
Return this object's parameters serialised as a single string.
Enquire(const Enquire &other)
Copying is allowed (and is cheap).
void delete_document(const std::string &unique_term)
Delete any documents indexed by a term from the database.
unsigned nonascii_to_utf8(unsigned ch, char *buf)
Convert a single non-ASCII Unicode character to UTF-8.
Define preprocessor symbols for the library version.
size_t get_num_subqueries() const
Get the number of subqueries of the top level query.
DatabaseOpeningError indicates failure to open a database.
Definition: error.h:581
Database(const std::string &path, int flags=0)
Open a Database, automatically determining the database backend to use.
MatchDecider filtering results based on whether document values are in a user-defined set.
Definition: valuesetmatchdecider.h:44
const int DB_OPEN
Open an existing database.
Definition: constants.h:50
BoolWeight()
Construct a BoolWeight.
Definition: weight.h:407
std::string serialise() const
Return this object's parameters serialised as a single string.
const int DB_CREATE_OR_OPEN
Create database if it doesn't already exist.
Definition: constants.h:35
DecreasingValueWeightPostingSource(Xapian::valueno slot_, Xapian::docid range_start_=0, Xapian::docid range_end_=0)
Construct a DecreasingValueWeightPostingSource.
int valueno_diff
A signed difference between two value slot numbers.
Definition: types.h:115
ESetIterator & operator++()
Advance the iterator to the next position.
Definition: eset.h:184
Indicates an attempt to access a database not present.
Definition: error.h:1055
std::string serialise() const
Serialise object parameters into a string.
PositionIterator positionlist_begin() const
Return a PositionIterator for the current term.
Stem()
Construct a Xapian::Stem object which doesn't change terms.
virtual void close()
Close the database.
@ CONTROL
Other, control (Cc)
Definition: unicode.h:236
ValueCountMatchSpy()
Construct an empty ValueCountMatchSpy.
Definition: matchspy.h:234
std::string name() const
Name of the posting source class.
InternalError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:777
KeyMaker subclass which combines several values.
Definition: keymaker.h:104
Base class for calculating distances between two lat/long coordinates.
Definition: geospatial.h:303
A posting source which returns a fixed weight for all documents.
Definition: postingsource.h:735
ExpandDecider * release()
Start reference counting this object.
Definition: expanddecider.h:65
Base class for stop-word decision functor.
Definition: queryparser.h:47
virtual std::string operator()(const Xapian::Document &doc) const =0
Build a key string for a Document.
void set_block_size(size_t block_size)
Set the block size to use for tables in the output database.
QueryParser & operator=(const QueryParser &o)
Assignment.
virtual std::string serialise() const
Return this object's parameters serialised as a single string.
@ UNASSIGNED
Other, not assigned (Cn)
Definition: unicode.h:221
SerialisationError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:953
void compact(const std::string &output, unsigned flags, int block_size, Xapian::Compactor &compactor)
Produce a compact version of this database.
Definition: database.h:719
std::string get_description() const
Return a string describing this object.
@ COMBINING_SPACING_MARK
Mark, spacing combining (Mc)
Definition: unicode.h:229
Database open(const std::string &dir)
Construct a Database object for read-only access to a Chert database.
Definition: dbfactory.h:123
std::string name() const
Return the name of this weighting scheme.
PL2PlusWeight(double c, double delta)
Construct a PL2PlusWeight.
const Query operator&(const Query &a, const Query &b)
Combine two Xapian::Query objects using OP_AND.
Definition: query.h:636
void index_text(const Xapian::Utf8Iterator &itor, Xapian::termcount wdf_inc=1, const std::string &prefix=std::string())
Index some text.
FixedWeightPostingSource * clone() const
Clone the posting source.
WritableDatabase(const std::string &path, int flags=0, int block_size=0)
Open a database for update, automatically determining the database backend to use.
void add(const std::string &word)
Add a single stop word.
Definition: queryparser.h:116
virtual Xapian::Query operator()(const std::string &str)=0
Convert a field-prefixed string to a Query object.
std::string get_description() const
Return a string describing this object.
const Stopper * release() const
Start reference counting this object.
Definition: queryparser.h:89
MSetIterator & operator--()
Move the iterator to the previous position.
Definition: mset.h:388
CoordWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
std::string serialise() const
Serialise object parameters into a string.
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
Xapian::TermIterator synonym_keys_end(const std::string &=std::string()) const
Corresponding end iterator to synonym_keys_begin(prefix).
Definition: database.h:455
const char * get_error_string() const
Returns any system error string associated with this exception.
PostingIterator & operator=(const PostingIterator &o)
Assignment.
ESet get_eset(Xapian::termcount maxitems, const RSet &omrset, int flags=0, const Xapian::ExpandDecider *edecider=0, double min_wt=0.0) const
Get the expand set for the given rset.
Xapian::Database get_database() const
The database we're reading values from.
Definition: postingsource.h:502
Handle a string range.
Definition: queryparser.h:458
virtual std::string serialise_results() const
Serialise the results of this match spy.
Xapian::docid get_docid() const
Return the current docid.
Xapian::doccount get_termfreq_min() const
A lower bound on the number of documents this object can return.
MatchDecider()
Default constructor.
Definition: enquire.h:127
Xapian::doccount get_termfreq() const
The number of documents which this term indexes.
Definition: weight.h:350
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Xapian::docid get_lastdocid() const
Get the highest document id which has been used in the database.
ValueIterator(const ValueIterator &o)
Copy constructor.
Xapian::docid replace_document(const std::string &unique_term, const Xapian::Document &document)
Replace any documents matching a term.
RangeProcessor(Xapian::valueno slot_, const std::string &str_=std::string(), unsigned flags_=0)
Constructor.
Definition: queryparser.h:183
Class representing a list of query expansion terms.
bool operator==(const ESetIterator &a, const ESetIterator &b)
Equality test for ESetIterator objects.
Definition: eset.h:277
std::string name() const
Return the name of this weighting scheme.
NumberValueRangeProcessor(Xapian::valueno slot_)
Constructor.
Definition: queryparser.h:660
Query & operator=(const Query &o)
Copying is allowed.
Definition: query.h:325
Database open_stub(const std::string &file)
Construct a Database object for a stub database file.
Definition: dbfactory.h:61
virtual bool operator()(const std::string &term) const
Is term a stop-word?
Definition: queryparser.h:118
DatabaseNotFoundError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:1079
std::string get_value_lower_bound(Xapian::valueno slot) const
Get a lower bound on the values stored in the given value slot.
difference_type operator-(const ESetIterator &o) const
Return the number of positions between o and this iterator.
Definition: eset.h:261
double pointwise_distance(const LatLongCoord &a, const LatLongCoord &b) const
Return the great-circle distance between points on the sphere.
virtual ~FieldProcessor()
Destructor.
op get_type() const
Get the type of the top level of the query.
const Query operator^=(const Query &o)
Combine with another Xapian::Query object using OP_XOR.
Definition: query.h:819
Virtual base class for key making functors.
Definition: keymaker.h:42
std::string get_description() const
Return a string describing this object.
virtual bool operator()(const std::string &term) const
Do we want this term in the ESet?
void init(const Xapian::Database &db_)
Set this PostingSource to the start of the list of postings.
LatLongDistanceKeyMaker(Xapian::valueno slot_, const LatLongCoords ¢re_, const LatLongMetric &metric_, double defdistance)
Construct a LatLongDistanceKeyMaker.
Definition: geospatial.h:574
void index_text_without_positions(const Xapian::Utf8Iterator &itor, Xapian::termcount wdf_inc=1, const std::string &prefix=std::string())
Index some text without positional information.
InternalError indicates a runtime problem of some sort.
Definition: error.h:761
ValueRangeProcessor()
Default constructor.
Definition: queryparser.h:406
InL2Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
const int DBCOMPACT_NO_RENUMBER
Use the same document ids in the output as in the input(s).
Definition: constants.h:256
Xapian::doccount get_termfreq_max() const
An upper bound on the number of documents this object can return.
Xapian::valueno operator()(std::string &begin, std::string &end)
Check for a valid string range.
Xapian::doccount size() const
Return number of items in this ESet object.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
SimpleStopper(Iterator begin, Iterator end)
Initialise from a pair of iterators.
Definition: queryparser.h:113
MSet & operator=(const MSet &o)
Copying is allowed.
TradWeight(double k=1.0)
Construct a TradWeight.
Definition: weight.h:768
category
Each Unicode character is in exactly one of these categories.
Definition: unicode.h:220
void add_value(const std::string &value)
Add a value to the test set.
Definition: valuesetmatchdecider.h:75
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
bool is_none() const
Return true if this is a no-op stemmer.
Definition: stem.h:166
bool reopen()
Re-open the database.
Query(op op_, const Xapian::Query &a, const Xapian::Query &b)
Construct a Query object by combining two others.
Definition: query.h:375
virtual ~WritableDatabase()
Destroy this handle on the database.
LMWeight(double param_log_=0.0, type_smoothing select_smoothing_=TWO_STAGE_SMOOTHING, double param_smoothing1_=-1.0, double param_smoothing2_=-1.0)
Construct a LMWeight.
Definition: weight.h:1439
virtual std::string name() const
Name of the posting source class.
bool has_positions() const
Does this database have any positional information?
const PostingSource * release() const
Start reference counting this object.
Definition: postingsource.h:384
@ OTHER_NUMBER
Number, other (No)
Definition: unicode.h:232
static const Xapian::Query MatchAll
A query matching all documents.
Definition: query.h:75
Class representing a list of search results.
Definition: eset.h:43
PostingIterator()
Default constructor.
Definition: postingiterator.h:80
Enquire(const Database &database)
Create a Xapian::Enquire object.
Xapian::doccount get_matches_lower_bound() const
Lower bound on the total number of matching documents.
Xapian::termcount get_wqf() const
The within-query-frequency of this term.
Definition: weight.h:362
TermIterator get_matching_terms_begin(Xapian::docid did) const
Get terms which match a given document, by document id.
FieldProcessor * release()
Start reference counting this object.
Definition: queryparser.h:751
InvalidOperationError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:299
std::string name() const
Name of the posting source class.
bool is_currency(unsigned ch)
Test if a given Unicode character is a currency symbol.
Definition: unicode.h:371
RSet()
Default constructor.
Xapian::doccount get_matches_estimated() const
Estimate of the total number of matching documents.
const TermIterator get_terms_end() const
End iterator for terms in the query object.
Definition: query.h:493
IfB2Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
virtual bool operator()(const std::string &term) const
Do we want this term in the ESet?
void set_metadata(const std::string &key, const std::string &metadata)
Set the user-specified metadata associated with a given key.
MSetIterator & operator+=(difference_type n)
Move the iterator forwards by n positions.
Definition: mset.h:424
double get_max_possible() const
The maximum possible weight any document could achieve.
std::string serialise() const
Serialise object parameters into a string.
std::string name() const
Return the name of this weighting scheme.
Stopper * release()
Start reference counting this object.
Definition: queryparser.h:77
void set_compaction_level(compaction_level compaction)
Set the compaction level.
Definition: compactor.h:116
KeyMaker * release()
Start reference counting this object.
Definition: keymaker.h:71
Query(op op_, const Xapian::Query &subquery, double factor)
Scale using OP_SCALE_WEIGHT.
@ OTHER_LETTER
Letter, other (Lo)
Definition: unicode.h:226
std::string get_sort_key() const
Return the sort key for the current position.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
void set_stopper_strategy(stop_strategy strategy)
Set the stopper strategy.
const int DB_BACKEND_GLASS
Use the glass backend.
Definition: constants.h:158
@ OP_AND
Match only documents which all subqueries match.
Definition: query.h:84
ExpandDeciderFilterTerms(Iterator reject_begin, Iterator reject_end)
The two iterators specify a list of terms to be rejected.
Definition: expanddecider.h:132
void clear_synonyms(const std::string &term) const
Remove all synonyms for a term.
std::string serialise() const
Return this object's parameters serialised as a single string.
void swap(ESet &o)
Efficiently swap this ESet object with another.
Definition: eset.h:95
FixedWeightPostingSource(double wt)
Construct a FixedWeightPostingSource.
ValueRangeProcessor * release()
Start reference counting this object.
Definition: queryparser.h:434
Database open(const std::string &host, unsigned int port, useconds_t timeout=10000, useconds_t connect_timeout=10000)
Construct a Database object for read-only access to a remote database accessed via a TCP connection.
XAPIAN_DOCID_BASE_TYPE doccount_diff
A signed difference between two counts of documents.
Definition: types.h:45
Query()
Construct a query matching no documents.
Definition: query.h:310
BoolWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
const char * raw() const
Return the raw const char* pointer for the current position.
Definition: unicode.h:54
Xapian::doccount size() const
The number of documents in this R-Set.
std::string get_value(Xapian::valueno slot) const
Get value by number.
InvalidOperationError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:307
std::string operator*() const
Return the term at the current position.
TermIterator allterms_begin(const std::string &prefix=std::string()) const
An iterator which runs across all terms with a given prefix.
This class provides an interface to the information retrieval system for the purpose of searching.
Definition: enquire.h:152
Xapian::docid range_end
End of range of docids for which weights are known to be decreasing.
Definition: postingsource.h:638
TermIterator termlist_end(Xapian::docid) const
Corresponding end iterator to termlist_begin().
Definition: database.h:238
@ OP_INVALID
Construct an invalid query.
Definition: query.h:254
void append_utf8(std::string &s, unsigned ch)
Append the UTF-8 representation of a single Unicode character to a std::string.
Definition: unicode.h:332
void remove_term(const std::string &tname)
Remove a term and all postings associated with it.
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterm) const
Calculate the weight contribution for this object's term to a document.
std::string name() const
Return the name of this weighting scheme.
virtual bool operator()(const std::string &term) const =0
Is term a stop-word?
DLHWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
virtual ~KeyMaker()
Virtual destructor, because we have virtual methods.
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
Definition: types.h:139
ESetIterator end() const
Return iterator pointing to just after the last item in this ESet.
Definition: eset.h:350
virtual bool at_end() const =0
Return true if the current position is past the last entry in this list.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void register_weighting_scheme(const Xapian::Weight &wt)
Register a weighting scheme.
void add_database(const Database &database)
Add an existing database (or group of databases) to those accessed by this object.
@ OP_XOR
Match documents which an odd number of subqueries match.
Definition: query.h:107
TermIterator top_values_begin(size_t maxvalues) const
Get an iterator over the most frequent values seen in the slot.
void clear_mappings()
Clear all mappings.
ValueSetMatchDecider(Xapian::valueno slot, bool inclusive_)
Construct a ValueSetMatchDecider.
Definition: valuesetmatchdecider.h:68
XAPIAN_TERMCOUNT_BASE_TYPE termcount_diff
A signed difference between two counts of terms.
Definition: types.h:79
AssertionError is thrown if a logical assertion inside Xapian fails.
Definition: error.h:199
@ DECIMAL_DIGIT_NUMBER
Number, decimal digit (Nd)
Definition: unicode.h:230
XAPIAN_TERMPOS_BASE_TYPE termpos_diff
A signed difference between two term positions.
Definition: types.h:90
@ LOWERCASE_LETTER
Letter, lowercase (Ll)
Definition: unicode.h:223
stop_strategy
Stopper strategies, for use with set_stopper_strategy().
Definition: termgenerator.h:127
void skip_to(const std::string &term)
Advance the iterator to term term.
DatabaseModifiedError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:563
@ LEAF_POSTING_SOURCE
Value returned by get_type() for a PostingSource.
Definition: query.h:260
ValueWeightPostingSource * clone() const
Clone the posting source.
virtual Xapian::Query operator()(const std::string &begin, const std::string &end)
Check for a valid range of this type.
static Document unserialise(const std::string &serialised)
Unserialise a document from a string produced by serialise().
This class implements the DPH weighting scheme.
Definition: weight.h:1331
void add_document(const Xapian::MSetIterator &i)
Add a document to the relevance set.
Definition: enquire.h:98
bool is_whitespace(unsigned ch)
Test if a given Unicode character is a whitespace character.
Definition: unicode.h:361
QueryParser(const QueryParser &o)
Copy constructor.
void set_database(const Database &db)
Specify the database being searched.
void add_mapping(const std::string &key, double wt)
Add a mapping.
Base class for field processors.
Definition: queryparser.h:722
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
This class implements the PL2 weighting scheme.
Definition: weight.h:1168
stat_flags
Stats which the weighting scheme can use (see need_stat()).
Definition: weight.h:38
Xapian::termcount get_unique_terms() const
Return the number of unique terms in the current document.
virtual ~LatLongMetric()
Destructor.
void set_time_limit(double time_limit)
Set a time limit for the match.
void remove_value(Xapian::valueno slot)
Remove any value with the given number.
const Query operator*(double factor, const Query &q)
Scale a Xapian::Query object using OP_SCALE_WEIGHT.
Definition: query.h:661
InternalError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:785
void add_document(Xapian::docid did)
Add a document to the relevance set.
ValueIterator values_end() const
Equivalent end iterator for values_begin().
Definition: document.h:271
ESetIterator operator+(ESetIterator::difference_type n, const ESetIterator &it)
Return ESetIterator it incremented by n positions.
Definition: eset.h:337
std::string get_description() const
Return a string describing this object.
virtual void merge_results(const std::string &serialised)
Unserialise some results, and merge them into this matchspy.
void add_posting(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1)
Add an occurrence of a term at a particular position.
Xapian::TermIterator synonym_keys_begin(const std::string &prefix=std::string()) const
An iterator which returns all terms which have synonyms.
virtual double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const =0
Calculate the term-independent weight component for a document.
virtual LatLongMetric * unserialise(const std::string &serialised) const =0
Create object given string serialisation returned by serialise().
DatabaseClosedError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:1113
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
void skip_if_in_range(double min_wt)
Skip the iterator forward if in the decreasing range, and weight is low.
Xapian::rev get_revision() const
Get the revision of the database.
Xapian::docid add_document(const Xapian::Document &document)
Add a new document to the database.
Class for iterating over a list of document ids.
An iterator which returns Unicode character values from a UTF-8 encoded string.
Definition: unicode.h:38
virtual Xapian::doccount get_termfreq_max() const =0
An upper bound on the number of documents this object can return.
QueryParserError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:903
ValueIterator valuestream_begin(Xapian::valueno slot) const
Return an iterator over the value in slot slot for each document.
Database(const Database &other)
Copying is allowed.
void remove_synonym(const std::string &term, const std::string &synonym) const
Remove a synonym for a term.
stem_strategy
Stemming strategies, for use with set_stemming_strategy().
Definition: termgenerator.h:122
void set_default_weight(double wt)
Set a default weight for document values not in the map.
void compact(const std::string &output, unsigned flags=0, int block_size=0)
Produce a compact version of this database.
Definition: database.h:623
~Query()
Destructor.
Definition: query.h:313
Xapian::Query operator()(const std::string &begin, const std::string &end)
Check for a valid numeric range.
Base class which provides an "external" source of postings.
Definition: postingsource.h:48
PositionIterator & operator++()
Advance the iterator to the next position.
const int DBCHECK_SHOW_FREELIST
Show the bitmap for the B-tree.
Definition: constants.h:222
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
ValueMapPostingSource(Xapian::valueno slot_)
Construct a ValueMapPostingSource.
ESet & operator=(const ESet &o)
Copying is allowed.
Base class for range processors.
Definition: queryparser.h:133
ExpandDecider subclass which restrict terms to a particular prefix.
Definition: expanddecider.h:143
TermIterator termlist_end() const
Equivalent end iterator for termlist_begin().
Definition: document.h:260
Xapian::doccount get_doccount() const
Get the number of documents in the database.
Query(const Query &o)
Copying is allowed.
Definition: query.h:319
unsigned tolower(unsigned ch)
Convert a Unicode character to lowercase.
Definition: unicode.h:376
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
@ PRIVATE_USE
Other, private use (Co)
Definition: unicode.h:238
MatchSpy()
Default constructor, needed by subclass constructors.
Definition: matchspy.h:60
Xapian::Weight subclass implementing the BM25 probabilistic formula.
Definition: weight.h:513
AssertionError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:215
std::string serialise() const
Return this object's parameters serialised as a single string.
NumberRangeProcessor(Xapian::valueno slot_, const std::string &str_=std::string(), unsigned flags_=0)
Constructor.
Definition: queryparser.h:375
virtual void skip_to(Xapian::docid did, double min_wt)
Advance to the specified docid.
bool operator<=(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
Definition: eset.h:327
A relevance set (R-Set).
Definition: enquire.h:60
ESet()
Default constructor.
void commit_transaction()
Complete the transaction currently in progress.
virtual Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
ESetIterator back() const
Return iterator pointing to the last object in this ESet.
Definition: eset.h:362
Indicates an attempt to use a feature which is unavailable.
Definition: error.h:719
Xapian::doccount get_termfreq(const std::string &term) const
Get the termfreq of a term.
virtual ~Weight()
Virtual destructor, because we have virtual methods.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
const Query operator&=(Query &a, const InvertedQuery_ &b)
Combine two Xapian::Query objects using OP_AND_NOT with result in the first.
Definition: query.h:726
int revision()
Report the revision of the library which the program is linked with.
Definition: xapian.h:142
bool contains(Xapian::docid did) const
Test if a given document in the relevance set.
void set_document(const Xapian::Document &doc)
Set the current document.
std::string sortable_serialise(double value)
Convert a floating point number to a string, preserving sort order.
Definition: queryparser.h:1305
Xapian::doclength get_avlength() const
Get the average length of the documents in the database.
int convert_to_percent(double weight) const
Convert a weight to a percentage.
Hierarchy of classes which Xapian can throw as exceptions.
bool is_wordchar(unsigned ch)
Test if a given Unicode character is "word character".
Definition: unicode.h:343
Handle a number range.
Definition: queryparser.h:335
std::string get_corrected_query_string() const
Get the spelling-corrected query string.
Decide if a Xapian::Error exception should be ignored.
virtual std::string get_description() const
Return a string describing this object.
Xapian::termcount get_doclength_lower_bound() const
A lower bound on the minimum length of any document in the database.
Definition: weight.h:378
LatLongMetric * clone() const
Clone the metric.
MSetIterator operator+(difference_type n) const
Return the iterator incremented by n positions.
Definition: mset.h:439
const Xapian::LatLongMetric * get_lat_long_metric(const std::string &name) const
Get a lat-long metric given a name.
BB2Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
const Query operator|(const Query &a, const Query &b)
Combine two Xapian::Query objects using OP_OR.
Definition: query.h:643
void set_sort_by_relevance_then_value(Xapian::valueno sort_key, bool reverse)
Set the sorting to be by relevance then value.
void next(double min_wt)
Advance the current position to the next matching document.
std::string operator()(const Xapian::Document &doc) const
Build a key string for a Document.
Class for iterating over document values.
Definition: valueiterator.h:40
int flags
For backward compatibility with Xapian 1.2.
Definition: termgenerator.h:98
std::string name() const
Return the name of this weighting scheme.
void index_text(const std::string &text, Xapian::termcount wdf_inc=1, const std::string &prefix=std::string())
Index some text in a std::string.
Definition: termgenerator.h:216
std::string get_description() const
Return a string describing this object.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
void compact(int fd, unsigned flags, int block_size, Xapian::Compactor &compactor)
Produce a compact version of this database.
Definition: database.h:774
std::string get_description() const
Return a string describing this object.
Class for counting the frequencies of values in the matching documents.
Definition: matchspy.h:205
RangeProcessor * release()
Start reference counting this object.
Definition: queryparser.h:223
void unserialise(const char **ptr, const char *end)
Unserialise a buffer and set this object to its coordinate.
std::string serialise() const
Serialise this object into a string.
void clear_matchspies()
Remove all the matchspies.
const ExpandDecider * release() const
Start reference counting this object.
Definition: expanddecider.h:77
virtual bool operator()(const std::string &term) const =0
Do we want this term in the ESet?
Xapian::doccount get_matches_upper_bound() const
Upper bound on the total number of matching documents.
const Query get_subquery(size_t n) const
Read a top level subquery.
InvalidArgumentError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:265
ValueIterator & operator=(const ValueIterator &o)
Assignment.
DatabaseError indicates some sort of database related error.
Definition: error.h:367
const Query operator/(const Query &q, double factor)
Inverse-scale a Xapian::Query object using OP_SCALE_WEIGHT.
Definition: query.h:683
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
FeatureUnavailableError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:735
The base class for exceptions indicating errors in the program logic.
Definition: error.h:154
@ LINE_SEPARATOR
Separator, line (Zl)
Definition: unicode.h:234
TermGenerator()
Default constructor.
Registry(const Registry &other)
Copy constructor.
virtual MatchSpy * unserialise(const std::string &serialised, const Registry &context) const
Unserialise parameters.
A sequence of latitude-longitude coordinates.
Definition: geospatial.h:232
double get_average_length() const
New name for get_avlength().
Definition: database.h:284
Indicates an attempt to access a closed database.
Definition: error.h:1097
const TermIterator get_terms_begin() const
Begin iterator for terms in the query object.
DatabaseError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:391
DateValueRangeProcessor(Xapian::valueno slot_, bool prefer_mdy_=false, int epoch_year_=1970)
Constructor.
Definition: queryparser.h:527
void set_max_word_length(unsigned max_word_length)
Set the maximum length word to index.
Class for iterating over a list of terms.
Definition: termiterator.h:41
@ MODIFIER_SYMBOL
Symbol, modified (Sk)
Definition: unicode.h:249
LatLongCoords()
Construct an empty container.
Definition: geospatial.h:266
Document(const Document &other)
Copying is allowed.
DatabaseModifiedError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:555
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
Xapian::termcount get_doclength_upper_bound() const
An upper bound on the maximum length of any document in the database.
Definition: weight.h:368
virtual double get_maxpart() const =0
Return an upper bound on what get_sumpart() can return for any document.
Stem(const std::string &language)
Construct a Xapian::Stem object for a particular language.
LatLongDistancePostingSource * clone() const
Clone the posting source.
PositionIterator & operator=(const PositionIterator &o)
Assignment.
bool operator>(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
Definition: eset.h:307
Class representing a stemming algorithm.
Definition: stem.h:62
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
@ OP_AND_NOT
Match documents which the first subquery matches but no others do.
Definition: query.h:99
const Xapian::Weight * get_weighting_scheme(const std::string &name) const
Get the weighting scheme given a name.
Query(op op_, I begin, I end, Xapian::termcount window=0)
Construct a Query object from a begin/end iterator pair.
Definition: query.h:458
DatabaseCorruptError indicates database corruption was detected.
Definition: error.h:409
void clear_values()
Remove all values associated with the document.
void remove_value(const std::string &value)
Remove a value from the test set.
Definition: valuesetmatchdecider.h:84
double operator()(const LatLongCoords &a, const std::string &b) const
Return the distance between two coordinate lists, in metres.
Definition: geospatial.h:337
An iterator across the values in a LatLongCoords object.
Definition: geospatial.h:165
void remove_spelling(const std::string &word, Xapian::termcount freqdec=1) const
Remove a word from the spelling dictionary.
virtual std::string serialise() const =0
Serialise object parameters into a string.
Indicates an error in the std::string serialisation of an object.
Definition: error.h:929
const int DBCHECK_FIX
Fix problems.
Definition: constants.h:243
virtual std::string get_description() const
Return a string describing this object.
std::string name() const
Return the name of this weighting scheme.
int major_version()
Report the major version of the library which the program is linked with.
Definition: xapian.h:124
Xapian::TermIterator metadata_keys_begin(const std::string &prefix=std::string()) const
An iterator which returns all user-specified metadata keys.
std::string name() const
Return the name of this weighting scheme.
#define XAPIAN_TOTALLENGTH_TYPE
Type for returning total document length.
Definition: version.h:80
Class for looking up user subclasses during unserialisation.
void add_source(const std::string &srcdir)
Add a source database.
void set_termfreq_min(Xapian::doccount termfreq_min_)
Set a lower bound on the term frequency.
Definition: postingsource.h:540
StringValueRangeProcessor(Xapian::valueno slot_)
Constructor.
Definition: queryparser.h:474
virtual std::string operator()(const std::string &word)=0
Stem the specified word.
virtual std::string serialise() const
Return this object's parameters serialised as a single string.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
Xapian::valueno get_slot() const
The slot we're reading values from.
Definition: postingsource.h:508
std::string serialise() const
Return a serialised form of the coordinate list.
void set_sort_by_key_then_relevance(Xapian::KeyMaker *sorter, bool reverse)
Set the sorting to be by keys generated from values, then by relevance for documents with identical k...
DPHWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
void set_stemming_strategy(stem_strategy strategy)
Set the stemming strategy.
bool check(Xapian::docid docid)
Check if the specified docid occurs.
DateRangeProcessor(Xapian::valueno slot_, const std::string &str_, unsigned flags_=0, int epoch_year_=1970)
Constructor.
Definition: queryparser.h:309
DatabaseNotFoundError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:1071
std::string serialise() const
Serialise object parameters into a string.
LatLongCoord(double latitude_, double longitude_)
Construct a coordinate.
Xapian::doccount get_termfreq_min() const
A lower bound on the number of documents this object can return.
std::string snippet(const std::string &text, size_t length=500, const Xapian::Stem &stemmer=Xapian::Stem(), unsigned flags=SNIPPET_BACKGROUND_MODEL|SNIPPET_EXHAUSTIVE, const std::string &hi_start="<b>", const std::string &hi_end="</b>", const std::string &omit="...") const
Generate a snippet.
Compact a database, or merge and compact several.
Definition: compactor.h:42
Handle a date range.
Definition: queryparser.h:245
std::string serialise() const
Return this object's parameters serialised as a single string.
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterm) const
Calculate the weight contribution for this object's term to a document.
std::string str
The prefix (or suffix if prefix==false) string to look for.
Definition: queryparser.h:467
CoordWeight * clone() const
Clone this object.
const int DB_NO_SYNC
Don't attempt to ensure changes have hit disk.
Definition: constants.h:66
void set_multipass(bool multipass)
Set whether to merge postlists in multiple passes.
Definition: compactor.h:102
Class for iterating over a list of terms.
void commit()
Commit any pending modifications made to the database.
PositionIterator positionlist_end() const
Return an end PositionIterator for the current term.
Definition: termiterator.h:104
void set_max_expansion(Xapian::termcount max_expansion, int max_type=Xapian::Query::WILDCARD_LIMIT_ERROR, unsigned flags=FLAG_WILDCARD|FLAG_PARTIAL)
Specify the maximum expansion of a wildcard and/or partial term.
std::string name() const
Name of the posting source class.
void set_database(const Xapian::WritableDatabase &db)
Set the database to index spelling data to.
This class implements the IneB2 weighting scheme.
Definition: weight.h:960
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
Query::op get_default_op() const
Get the current default operator.
const std::string & get_context() const
Optional context information.
Definition: error.h:133
BB2Weight(double c)
Construct a BB2Weight.
Xapian::TermIterator spellings_end() const
Corresponding end iterator to spellings_begin().
Definition: database.h:432
void set_sort_by_relevance_then_key(Xapian::KeyMaker *sorter, bool reverse)
Set the sorting to be by relevance, then by keys generated from values.
Database(int fd, int flags=0)
Open a single-file Database.
const std::string & get_msg() const
Message giving details of the error, intended for human consumption.
Definition: error.h:122
static const Xapian::Query MatchNothing
A query matching no documents.
Definition: query.h:65
~Enquire()
Close the Xapian::Enquire object.
virtual std::string get_description() const
Return a string describing this object.
UnimplementedError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:349
TermIterator()
Default constructor.
Definition: termiterator.h:80
size_t size() const
Get the number of coordinates in the container.
Definition: geospatial.h:248
@ OTHER_SYMBOL
Symbol, other (So)
Definition: unicode.h:250
virtual Weight * clone() const =0
Clone this object.
AssertionError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:223
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Handle a number range.
Definition: queryparser.h:654
bool locked() const
Test if this database is currently locked for writing.
WritableDatabase open()
Construct a WritableDatabase object for a new, empty InMemory database.
Definition: dbfactory.h:104
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
PL2Weight(double c)
Construct a PL2Weight.
Iterator over a Xapian::MSet.
Definition: mset.h:351
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
PostingSource * release()
Start reference counting this object.
Definition: postingsource.h:372
ExpandDecider subclass which rejects terms using two ExpandDeciders.
Definition: expanddecider.h:88
const TermIterator get_unique_terms_end() const
End iterator for unique terms in the query object.
Definition: query.h:507
std::string serialise() const
Return this object's parameters serialised as a single string.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
PositionIterator()
Default constructor.
Definition: positioniterator.h:81
DatabaseVersionError indicates that a database is in an unsupported format.
Definition: error.h:632
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
LMWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
void add_matchspy(MatchSpy *spy)
Add a matchspy.
void operator=(const Enquire &other)
Assignment is allowed (and is cheap).
const int DB_DANGEROUS
Update the database in-place.
Definition: constants.h:103
Xapian::termcount get_unique_terms(Xapian::docid did) const
Get the number of unique terms in document.
PositionIterator positionlist_end() const
Return an end PositionIterator for the current document.
Definition: postingiterator.h:109
DocNotFoundError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:690
BM25Weight(double k1, double k2, double k3, double b, double min_normlen)
Construct a BM25Weight.
Definition: weight.h:558
const int DBCHECK_FULL_TREE
Show a full display of the B-tree contents.
Definition: constants.h:216
virtual MatchSpy * unserialise(const std::string &serialised, const Registry &context) const
Unserialise parameters.
@ SPACE_SEPARATOR
Separator, space (Zs)
Definition: unicode.h:233
ValueIterator()
Default constructor.
Definition: valueiterator.h:81
const int DBCHECK_SHORT_TREE
Show a short-format display of the B-tree contents.
Definition: constants.h:210
void skip_to(Xapian::termpos termpos)
Advance the iterator to term position termpos.
BM25PlusWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
MSetIterator & operator-=(difference_type n)
Move the iterator back by n positions.
Definition: mset.h:430
Class for iterating over a list of terms.
Definition: postingiterator.h:41
Indicates a query string can't be parsed.
Definition: error.h:887
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Decide if a Xapian::Error exception should be ignored.
Definition: errorhandler.h:51
QueryParser()
Default constructor.
const ErrorHandler * release() const
Start reference counting this object.
Definition: errorhandler.h:117
ErrorHandler * release()
Start reference counting this object.
Definition: errorhandler.h:105
void done()
End the iteration.
Definition: postingsource.h:522
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterm) const
Calculate the weight contribution for this object's term to a document.
~TermGenerator()
Destructor.
@ DASH_PUNCTUATION
Punctuation, dash (Pd)
Definition: unicode.h:241
virtual MatchSpy * clone() const
Clone the match spy.
virtual std::string get_description() const =0
Return a string describing this object.
void set_query(const Xapian::Query &query, Xapian::termcount qlen=0)
Set the query to run.
ESetIterator & operator+=(difference_type n)
Move the iterator forwards by n positions.
Definition: eset.h:233
const ValueRangeProcessor * release() const
Start reference counting this object.
Definition: queryparser.h:446
MultiValueKeyMaker(Iterator begin, Iterator end)
Construct a MultiValueKeyMaker from a pair of iterators.
Definition: keymaker.h:125
DatabaseError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:383
DatabaseCorruptError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:425
const Query operator^(const Query &a, const Query &b)
Combine two Xapian::Query objects using OP_XOR.
Definition: query.h:650
double metres_to_miles(double metres)
Convert from metres to miles.
Definition: geospatial.h:67
ESetIterator operator--(int)
Move the iterator to the previous position (postfix version).
Definition: eset.h:203
Xapian::termcount get_doclength(Xapian::docid did) const
Get the length of a document.
virtual Xapian::valueno operator()(std::string &begin, std::string &end)=0
Check for a valid range of this type.
virtual std::string resolve_duplicate_metadata(const std::string &key, size_t num_tags, const std::string tags[])
Resolve multiple user metadata entries with the same key.
Utf8Iterator & operator++()
Move forward to the next Unicode character.
Definition: unicode.h:176
virtual ~Database()
Destroy this handle on the database.
void add_prefix(const std::string &field, const std::string &prefix)
Add a free-text field term prefix.
LatLongDistanceKeyMaker(Xapian::valueno slot_, const LatLongCoord ¢re_, const LatLongMetric &metric_)
Construct a LatLongDistanceKeyMaker.
Definition: geospatial.h:650
virtual double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const =0
Calculate the weight contribution for this object's term to a document.
bool empty() const
Test if this R-Set is empty.
TermIterator get_matching_terms_begin(const MSetIterator &it) const
Get terms which match a given document, by match set item.
Query(op op_, const std::string &a, const std::string &b)
Construct a Query object by combining two terms.
Definition: query.h:390
MSetIterator end() const
Return iterator pointing to just after the last item in this MSet.
Definition: mset.h:612
Xapian::termcount values_count() const
Count the values in this document.
Xapian::termcount get_wdf_upper_bound() const
An upper bound on the wdf of this term.
Definition: weight.h:386
PostingIterator & operator++()
Advance the iterator to the next position.
void operator=(const WritableDatabase &other)
Assignment is allowed.
unsigned valueno
The number for a value slot in a document.
Definition: types.h:108
SerialisationError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:945
Compact a database, or merge and compact several.
size_t get_total() const
Return the total number of documents tallied.
Definition: matchspy.h:241
int percent
The percentage score for a document in an MSet.
Definition: types.h:66
std::string name() const
Return the name of this weighting scheme.
DecreasingValueWeightPostingSource * unserialise(const std::string &serialised) const
Create object given string serialisation returned by serialise().
std::string name() const
Return the full name of the metric.
double doclength
A normalised document length.
Definition: types.h:59
QueryParserError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:911
Xapian::doccount get_value_freq(Xapian::valueno slot) const
Return the frequency of a given value slot.
Weight(const Weight &)
Don't allow copying.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
The base class for exceptions indicating errors only detectable at runtime.
Definition: error.h:176
const int DB_BACKEND_INMEMORY
Use the "in memory" backend.
Definition: constants.h:195
API for working with Xapian databases.
DPHWeight()
Construct a DPHWeight.
Definition: weight.h:1348
Constants in the Xapian namespace.
All exceptions thrown by Xapian are subclasses of Xapian::Error.
Definition: error.h:43
IneB2Weight(double c)
Construct an IneB2Weight.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
virtual std::string name() const =0
Return the full name of the metric.
Xapian::TermIterator synonyms_begin(const std::string &term) const
An iterator which returns all the synonyms for a given term.
virtual MatchSpy * clone() const
Clone the match spy.
double sortable_unserialise(const std::string &serialised)
Convert a string encoded using sortable_serialise back to a floating point number.
External sources of posting information.
LatLongDistancePostingSource(Xapian::valueno slot_, const LatLongCoords ¢re_, const LatLongMetric &metric_, double max_range_=0.0, double k1_=1000.0, double k2_=1.0)
Construct a new posting source which returns only documents within range of one of the central coordi...
bool at_end() const
Return true if the current position is past the last entry in this list.
Class for iterating over term positions.
void remove_posting(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfdec=1)
Remove a posting of a term from the document.
ExpandDecider subclass which rejects terms in a specified list.
Definition: expanddecider.h:119
double get_weight() const
Return the weight contribution for the current document.
void add_rangeprocessor(Xapian::RangeProcessor *range_proc, const std::string *grouping=NULL)
Register a RangeProcessor.
virtual std::string name() const
Return the name of this weighting scheme.
Xapian::Document get_document() const
Get the Document object for the current position.
LatLongDistancePostingSource(Xapian::valueno slot_, const LatLongCoords ¢re_, double max_range_=0.0, double k1_=1000.0, double k2_=1.0)
Construct a new posting source which returns only documents within range of one of the central coordi...
virtual void set_status(const std::string &table, const std::string &status)
Update progress.
Xapian::doccount get_firstitem() const
Rank of first item in this MSet.
void set_stemming_strategy(stem_strategy strategy)
Set the stemming strategy.
bool empty() const
Return true if this MSet object is empty.
Definition: mset.h:283
IfB2Weight(double c)
Construct an IfB2Weight.
BM25PlusWeight(double k1, double k2, double k3, double b, double min_normlen, double delta)
Construct a BM25PlusWeight.
Definition: weight.h:672
Simple implementation of Stopper class - this will suit most users.
Definition: queryparser.h:96
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Definition: types.h:83
TermIterator stoplist_end() const
End iterator over terms omitted from the query as stopwords.
Definition: queryparser.h:1210
MSet(const MSet &o)
Copying is allowed.
void operator=(const RSet &rset)
Assignment operator.
A posting source which looks up weights in a map using values as the key.
Definition: postingsource.h:686
UnimplementedError indicates an attempt to use an unimplemented feature.
Definition: error.h:325
void next(double min_wt)
Advance the current position to the next matching document.
ValueWeightPostingSource(Xapian::valueno slot_)
Construct a ValueWeightPostingSource.
WritableDatabase open_writable(const std::string &host, unsigned int port, useconds_t timeout=0, useconds_t connect_timeout=10000, int flags=0)
Construct a WritableDatabase object for update access to a remote database accessed via a TCP connect...
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
Virtual base class for expand decider functor.
Definition: expanddecider.h:38
virtual ~Stopper()
Class has virtual methods, so provide a virtual destructor.
Definition: queryparser.h:65
size_t left() const
Return the number of bytes left in the iterator's buffer.
Definition: unicode.h:59
LatLongDistanceKeyMaker(Xapian::valueno slot_, const LatLongCoord ¢re_, const LatLongMetric &metric_, double defdistance)
Construct a LatLongDistanceKeyMaker.
Definition: geospatial.h:629
std::string get_description() const
Return a string describing this object.
DateValueRangeProcessor(Xapian::valueno slot_, const std::string &str_, bool prefix_=true, bool prefer_mdy_=false, int epoch_year_=1970)
Constructor.
Definition: queryparser.h:569
std::string get_value() const
Read current value.
Definition: postingsource.h:514
virtual Xapian::doccount get_termfreq_min() const =0
A lower bound on the number of documents this object can return.
Xapian::docid get_docid() const
Return the docid at the current position.
Class representing a list of search results.
Definition: mset.h:44
ESetIterator operator-(difference_type n) const
Return the iterator decremented by n positions.
Definition: eset.h:256
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Definition: types.h:38
DatabaseLockError indicates failure to lock a database.
Definition: error.h:493
Abstract base class for weighting schemes.
Definition: weight.h:35
@ ENCLOSING_MARK
Mark, enclosing (Me)
Definition: unicode.h:228
@ LETTER_NUMBER
Number, letter (Nl)
Definition: unicode.h:231
void set_termfreq_max(Xapian::doccount termfreq_max_)
An upper bound on the term frequency.
Definition: postingsource.h:562
const Xapian::Query & get_query() const
Get the current query.
DatabaseCorruptError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:433
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
Xapian::doccount get_uncollapsed_matches_lower_bound() const
Lower bound on the total number of matching documents before collapsing.
LatLongDistancePostingSource * unserialise_with_registry(const std::string &serialised, const Registry ®istry) const
Create object given string serialisation returned by serialise().
ESet(const ESet &o)
Copying is allowed.
void remove_document(const Xapian::MSetIterator &i)
Remove a document from the relevance set.
Definition: enquire.h:104
This class implements the InL2 weighting scheme.
Definition: weight.h:816
~PostingIterator()
Destructor.
Definition: postingiterator.h:84
RangeError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:987
Xapian::Weight subclass implementing the PL2+ probabilistic formula.
Definition: weight.h:1235
virtual std::string get_description() const
Return a string describing this object.
Base class for value range processors.
Definition: queryparser.h:397
virtual std::string operator()(const Xapian::Document &doc) const
Build a key string for a Document.
FeatureUnavailableError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:743
virtual std::string get_description() const
Return a string describing this object.
double get_weight() const
Return the weight contribution for the current document.
Query parse_query(const std::string &query_string, unsigned flags=FLAG_DEFAULT, const std::string &default_prefix=std::string())
Parse a query.
MSetIterator operator--(int)
Move the iterator to the previous position (postfix version).
Definition: mset.h:394
TermIterator stoplist_begin() const
Begin iterator over terms omitted from the query as stopwords.
Unicode and UTF-8 related classes and functions.
#define XAPIAN_TERMPOS_BASE_TYPE
Base (signed) type for Xapian::termpos.
Definition: version.h:77
void set_termfreq_est(Xapian::doccount termfreq_est_)
An estimate of the term frequency.
Definition: postingsource.h:551
double get_max_attained() const
The maximum weight attained by any document.
Xapian::docid get_docid() const
Return the current docid.
const int DB_BACKEND_STUB
Open a stub database file.
Definition: constants.h:179
void compact(int fd, unsigned flags=0, int block_size=0)
Produce a compact version of this database.
Definition: database.h:671
std::string get_data() const
Get data stored in the document.
std::string serialise() const
Serialise object parameters into a string.
BM25Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
ExpandDeciderAnd(const ExpandDecider *first_, const ExpandDecider *second_)
Compatibility method.
Definition: expanddecider.h:107
@ WILDCARD_LIMIT_ERROR
Throw an error if OP_WILDCARD exceeds its expansion limit.
Definition: query.h:282
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
std::string operator*() const
Return the value at the current position.
virtual double pointwise_distance(const LatLongCoord &a, const LatLongCoord &b) const =0
Return the distance between two coordinates, in metres.
virtual bool operator()(const Xapian::Document &doc) const =0
Decide whether we want this document to be in the MSet.
PL2Weight * unserialise(const std::string &serialised) const
Unserialise parameters.
DateRangeProcessor(Xapian::valueno slot_, unsigned flags_=0, int epoch_year_=1970)
Constructor.
Definition: queryparser.h:262
LatLongDistanceKeyMaker(Xapian::valueno slot_, const LatLongCoord ¢re_)
Construct a LatLongDistanceKeyMaker.
Definition: geospatial.h:671
InvalidOperationError indicates the API was used in an invalid way.
Definition: error.h:283
bool check(Xapian::docid min_docid, double min_wt)
Check if the specified docid occurs.
NetworkError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:827
std::string serialise() const
Return this object's parameters serialised as a single string.
Stem(const std::string &language, bool fallback)
Construct a Xapian::Stem object for a particular language.
size_t size() const
Return number of shards in this Database object.
Definition: database.h:93
void set_weighting_scheme(const Weight &weight_)
Set the weighting scheme to use for queries.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
MSetIterator back() const
Return iterator pointing to the last object in this MSet.
Definition: mset.h:624
PostingIterator postlist_begin(const std::string &tname) const
An iterator pointing to the start of the postlist for a given term.
#define XAPIAN_TERMCOUNT_BASE_TYPE
Base (signed) type for Xapian::termcount and related types.
Definition: version.h:74
const MatchSpy * release() const
Start reference counting this object.
Definition: matchspy.h:196
std::string get_description() const
Return a string describing this object.
void add_valuerangeprocessor(Xapian::ValueRangeProcessor *vrproc)
Register a ValueRangeProcessor.
Definition: queryparser.h:1231
Xapian::doccount get_uncollapsed_matches_estimated() const
Estimate of the total number of matching documents before collapsing.
WritableDatabase()
Create a WritableDatabase with no subdatabases.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.
std::string name() const
Return the name of this weighting scheme.
Xapian::termcount get_collection_freq(const std::string &tname) const
Return the total number of occurrences of the given term.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Indicates a timeout expired while communicating with a remote database.
Definition: error.h:845
Base class for matcher decision functor.
Definition: enquire.h:118
@ UPPERCASE_LETTER
Letter, uppercase (Lu)
Definition: unicode.h:222
Xapian::termcount get_wdf_upper_bound(const std::string &term) const
Get an upper bound on the wdf of term term.
Xapian::valueno operator()(std::string &begin, std::string &end)
Check for a valid numeric range.
std::string get_description() const
Return a string describing this object.
Xapian::valueno operator()(std::string &begin, std::string &end)
Check for a valid date range.
Xapian::docid operator*() const
Return the document id at the current position.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
Xapian::termcount get_length() const
Return the length of this query object.
WildcardError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:1037
Class representing a stemming algorithm implementation.
Definition: stem.h:40
const int DBCHECK_SHOW_STATS
Show statistics for the B-tree.
Definition: constants.h:228
StringValueRangeProcessor(Xapian::valueno slot_, const std::string &str_, bool prefix_=true)
Constructor.
Definition: queryparser.h:485
Parses a piece of text and generate terms.
Definition: termgenerator.h:48
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
#define XAPIAN_REVISION_TYPE
Underlying type for Xapian::rev.
Definition: version.h:83
Iterator over a Xapian::ESet.
Definition: eset.h:160
WritableDatabase(const WritableDatabase &other)
Copying is allowed.
MSetIterator & operator++()
Advance the iterator to the next position.
Definition: mset.h:375
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
std::string name() const
Name of the posting source class.
InL2Weight(double c)
Construct an InL2Weight.
Query(op op_, Xapian::valueno slot, const std::string &range_limit)
Construct a Query object for a single-ended value range.
Xapian::doccount get_uncollapsed_matches_upper_bound() const
Upper bound on the total number of matching documents before collapsing.
bool operator==(const LatLongCoordsIterator &other) const
Equality test for LatLongCoordsIterator objects.
Definition: geospatial.h:199
std::string name() const
Return the name of this weighting scheme.
bool empty() const
Check if this query is Xapian::Query::MatchNothing.
Definition: query.h:515
Xapian::doclength get_average_length() const
The average length of a document in the collection.
Definition: weight.h:347
Xapian::termpos get_termpos() const
Get the current term position.
KeyMaker subclass which sorts by distance from a latitude/longitude.
Definition: geospatial.h:551
std::string serialise() const
Return this object's parameters serialised as a single string.
DatabaseOpeningError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:597
Posting source which returns a weight based on geospatial distance.
Definition: geospatial.h:455
Xapian::doccount get_reltermfreq() const
The number of relevant documents which this term indexes.
Definition: weight.h:353
StemImplementation()
Default constructor.
Definition: stem.h:49
DerefWrapper_< LatLongCoord > operator++(int)
Advance the iterator to the next position (postfix version).
Definition: geospatial.h:192
double latitude
A latitude, as decimal degrees.
Definition: geospatial.h:88
std::string name() const
Return the name of this weighting scheme.
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterm) const
Calculate the weight contribution for this object's term to a document.
Xapian::doccount get_collapse_count() const
Return a count of the number of collapses done onto the current key.
GreatCircleMetric()
Construct a GreatCircleMetric.
bool term_exists(const std::string &tname) const
Check if a given term exists in the database.
Xapian::docid range_start
Start of range of docids for which weights are known to be decreasing.
Definition: postingsource.h:632
TermIterator & operator++()
Advance the iterator to the next position.
std::string operator()(const std::string &word) const
Stem a word.
virtual std::string serialise() const
Return this object's parameters serialised as a single string.
MatchDecider subclass for filtering results by value.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
const TermIterator get_unique_terms_begin() const
Begin iterator for unique terms in the query object.
std::string name() const
Return the name of this weighting scheme.
std::string get_description() const
Return a string describing this object.
void cancel_transaction()
Abort the transaction currently in progress, discarding the pending modifications made to the databas...
static const Query unserialise(const std::string &serialised, const Registry ®=Registry())
Unserialise a string and return a Query object.
double get_weight() const
Get the weight for the current position.
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
Xapian::Weight subclass implementing the Language Model formula.
Definition: weight.h:1384
Xapian::termcount get_collection_freq() const
The collection frequency of the term.
Definition: weight.h:356
std::string get_description() const
Return a string describing this object.
ESetIterator & operator--()
Move the iterator to the previous position.
Definition: eset.h:197
std::string get_description() const
Return a string describing this object.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
Xapian::termcount get_ebound() const
Return a bound on the full size of this ESet object.
std::string get_description() const
Return a string describing this object.
@ FORMAT
Other, format (Cf)
Definition: unicode.h:237
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterm) const
Calculate the weight contribution for this object's term to a document.
void add_boolean_prefix(const std::string &field, const std::string &prefix, bool exclusive)
Add a boolean term prefix allowing the user to restrict a search with a boolean filter specified in t...
Definition: queryparser.h:1176
Xapian::doccount get_rset_size() const
The number of documents marked as relevant.
Definition: weight.h:344
bool at_end() const
Return true if the current position is past the last entry in this list.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Definition: types.h:52
const char * get_type() const
The type of this error (e.g. "DocNotFoundError".)
Definition: error.h:117
Read weights from a value which is known to decrease as docid increases.
Definition: postingsource.h:626
DerefWrapper_< Xapian::termpos > operator++(int)
Advance the iterator to the next position (postfix version).
Definition: positioniterator.h:96
double get_maxweight() const
Return the currently set upper bound on what get_weight() can return.
Definition: postingsource.h:131
LatLongDistanceKeyMaker(Xapian::valueno slot_, const LatLongCoords ¢re_)
Construct a LatLongDistanceKeyMaker.
Definition: geospatial.h:614
LatLongDistanceKeyMaker(Xapian::valueno slot_, const LatLongCoords ¢re_, const LatLongMetric &metric_)
Construct a LatLongDistanceKeyMaker.
Definition: geospatial.h:594
bool get_started() const
Flag indicating if we've started (true if we have).
Definition: postingsource.h:531
parse free text and generate terms
This class provides read/write access to a database.
Definition: database.h:785
PL2PlusWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
const int DBCOMPACT_MULTIPASS
If merging more than 3 databases, merge the postlists in multiple passes.
Definition: constants.h:262
RangeProcessor()
Default constructor.
Definition: queryparser.h:165
DocNotFoundError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:698
TradWeight * unserialise(const std::string &serialised) const
Unserialise parameters.
TfIdfWeight()
Construct a TfIdfWeight using the default normalizations ("ntn").
Definition: weight.h:487
double get_maxpart() const
Return an upper bound on what get_sumpart() can return for any document.
MatchSpy * release()
Start reference counting this object.
Definition: matchspy.h:184
void set_destdir(const std::string &destdir)
Set where to write the output.
void skip_to(Xapian::docid min_docid, double min_wt)
Advance to the specified docid.
virtual Xapian::docid get_docid() const =0
Return the current docid.
The Xapian namespace contains public interfaces for the Xapian library.
Definition: error.h:34
DatabaseLockError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:517
WildcardError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:1029
Calculate the great-circle distance between two coordinates on a sphere.
Definition: geospatial.h:399
@ CURRENCY_SYMBOL
Symbol, currency (Sc)
Definition: unicode.h:248
void set_sort_by_key(Xapian::KeyMaker *sorter, bool reverse)
Set the sorting to be by key generated from values only.
void assign(const std::string &s)
Assign a new string to the iterator.
Definition: unicode.h:92
NetworkTimeoutError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:869
Stem(const Stem &o)
Copy constructor.
std::string get_description() const
Return a string describing this object.
std::string name() const
Return the name of this weighting scheme.
virtual ~ExpandDecider()
Virtual destructor, because we have virtual methods.
void add_spelling(const std::string &word, Xapian::termcount freqinc=1) const
Add a word to the spelling dictionary.
void operator()(const Xapian::Document &doc, double wt)
Implementation of virtual operator().
void set_stemmer(const Xapian::Stem &stemmer)
Set the stemmer.
DatabaseCreateError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:475
TermIterator top_values_end(size_t) const
End iterator corresponding to top_values_begin()
Definition: matchspy.h:272
compaction_level
Compaction level.
Definition: compactor.h:48
TermIterator values_begin() const
Get an iterator over the values seen in the slot.
Utf8Iterator(const char *p_)
Create an iterator given a pointer to a null terminated string.
DatabaseClosedError(const std::string &msg_, int errno_)
Construct from message and errno value.
Definition: error.h:1121
LatLongCoordsIterator end() const
Get an end iterator for the coordinates.
Definition: geospatial.h:243
virtual ~MatchSpy()
Virtual destructor, because we have virtual methods.
Xapian::Weight subclass implementing the tf-idf weighting scheme.
Definition: weight.h:425
Class representing a query.
Definition: query.h:46
void skip_to(Xapian::docid did)
Advance the iterator to document did.
TermIterator values_end() const
End iterator corresponding to values_begin()
Definition: matchspy.h:255
void set_max_wildcard_expansion(Xapian::termcount)
Specify the maximum expansion of a wildcard.
Definition: queryparser.h:1268
std::string serialise() const
Return this object's parameters serialised as a single string.
Xapian::docid operator*() const
Get the numeric document id for the current position.
PositionIterator positionlist_begin(Xapian::docid did, const std::string &tname) const
An iterator pointing to the start of the position list for a given term in a given document.
ESetIterator operator+(difference_type n) const
Return the iterator incremented by n positions.
Definition: eset.h:248
void set_renumber(bool renumber)
Set whether to preserve existing document id values.
Definition: compactor.h:90
ESetIterator operator++(int)
Advance the iterator to the next position (postfix version).
Definition: eset.h:190
bool empty() const
Return true if and only if there are no coordinates in the container.
Definition: geospatial.h:254
void swap(MSet &o)
Efficiently swap this MSet object with another.
Definition: mset.h:286
TfIdfWeight(const std::string &normalizations)
Construct a TfIdfWeight.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
std::string serialise() const
Serialise object parameters into a string.
Mechanism for accessing a struct of constant information.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
@ FLAG_WILDCARD
Support wildcards.
Definition: queryparser.h:801
RangeError indicates an attempt to access outside the bounds of a container.
Definition: error.h:971
std::string name() const
Name of the posting source class.
virtual bool check(Xapian::docid did, double min_wt)
Check if the specified docid occurs.
virtual ~RangeProcessor()
Destructor.
void index_text_without_positions(const std::string &text, Xapian::termcount wdf_inc=1, const std::string &prefix=std::string())
Index some text in a std::string without positional information.
Definition: termgenerator.h:246
void add_boolean_prefix(const std::string &field, Xapian::FieldProcessor *proc, bool exclusive)
Register a FieldProcessor for a boolean prefix.
Definition: queryparser.h:1196
double operator()(const LatLongCoords &a, const char *b_ptr, size_t b_len) const
Return the distance between two coordinate lists, in metres.
DerefWrapper_< Xapian::docid > operator++(int)
Advance the iterator to the next position (postfix version).
Definition: postingiterator.h:117
virtual void next(double min_wt)=0
Advance the current position to the next matching document.
Xapian::valueno slot
The value slot to process.
Definition: queryparser.h:145
ValuePostingSource(Xapian::valueno slot_)
Construct a ValuePostingSource.
Query(Xapian::PostingSource *source)
Construct a Query object for a PostingSource.
MSetIterator operator-(difference_type n) const
Return the iterator decremented by n positions.
Definition: mset.h:447
virtual void init(const Database &db)=0
Set this PostingSource to the start of the list of postings.
void next(double min_wt)
Advance the current position to the next matching document.
ESetIterator begin() const
Return iterator pointing to the first item in this ESet.
Definition: eset.h:345
void delete_document(Xapian::docid did)
Delete a document from the database.
Xapian::termcount termlist_count() const
The length of the termlist - i.e.
double get_weight() const
Return the weight contribution for the current document.
Stem & operator=(const Stem &o)
Assignment.
Xapian::Query check_range(const std::string &b, const std::string &e)
Check prefix/suffix on range.
ESetIterator()
Create an unpositioned ESetIterator.
Definition: eset.h:178
Xapian::termcount get_doclength_lower_bound() const
Get a lower bound on the length of a document in this DB.
bool operator!=(const ESetIterator &a, const ESetIterator &b)
Inequality test for ESetIterator objects.
Definition: eset.h:287
void remove_document(Xapian::docid did)
Remove a document from the relevance set.
void add_prefix(const std::string &field, Xapian::FieldProcessor *proc)
Register a FieldProcessor.
Query(double factor, const Xapian::Query &subquery)
Scale using OP_SCALE_WEIGHT.
void init(const Database &db_)
Set this PostingSource to the start of the list of postings.
FieldProcessor()
Default constructor.
Definition: queryparser.h:731
std::string get_spelling_suggestion(const std::string &word, unsigned max_edit_distance=2) const
Suggest a spelling correction.
Geospatial search support routines.
double get_sumextra(Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the term-independent weight component for a document.
const int DB_NO_TERMLIST
When creating a database, don't create a termlist table.
Definition: constants.h:136
A handle representing a document in a Xapian database.
Definition: document.h:61
ValueIterator values_begin() const
Iterator for the values in this document.
Query(op op_, const std::string &pattern, Xapian::termcount max_expansion=0, int max_type=WILDCARD_LIMIT_ERROR, op combiner=OP_SYNONYM)
Query constructor for OP_WILDCARD queries.
Xapian::Weight subclass implementing the BM25+ probabilistic formula.
Definition: weight.h:617
const int DB_BACKEND_CHERT
Use the chert backend.
Definition: constants.h:170
virtual std::string serialise() const
Serialise object parameters into a string.
double get_termweight(const std::string &term) const
Get the term weight of a term.
ValueIterator & operator++()
Advance the iterator to the next position.
This class is used to access a database, or a group of databases.
Definition: database.h:68
std::string operator*() const
Get the term at the current position.
void set_collapse_key(Xapian::valueno collapse_key, Xapian::doccount collapse_max=1)
Set the collapse key to use for queries.
DateValueRangeProcessor(Xapian::valueno slot_, const char *str_, bool prefix_=true, bool prefer_mdy_=false, int epoch_year_=1970)
Constructor.
Definition: queryparser.h:620
std::string get_description() const
Return a string describing this object.
docid_order
Ordering of docids.
Definition: enquire.h:322
DecreasingValueWeightPostingSource * clone() const
Clone the posting source.
Database()
Create a Database with no databases in.
double get_maxextra() const
Return an upper bound on what get_sumextra() can return for any document.
Class representing a list of search results.
Query(op op_, Xapian::valueno slot, const std::string &range_lower, const std::string &range_upper)
Construct a Query object for a value range.
UnimplementedError(const std::string &msg_, const std::string &context_=std::string(), int errno_=0)
General purpose constructor.
Definition: error.h:341
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterm) const
Calculate the weight contribution for this object's term to a document.
~PositionIterator()
Destructor.
Definition: positioniterator.h:85
virtual ~ErrorHandler()
We require a virtual destructor because we have virtual methods.
bool contains(const Xapian::MSetIterator &i) const
Test if a given document in the relevance set.
Definition: enquire.h:110
@ LEAF_MATCH_ALL
Value returned by get_type() for MatchAll or equivalent.
Definition: query.h:267
MSet get_mset(Xapian::doccount first, Xapian::doccount maxitems, const RSet *omrset, const MatchDecider *mdecider=0) const
Get (a portion of) the match set for the current query.
Definition: enquire.h:576
void add_synonym(const std::string &term, const std::string &synonym) const
Add a synonym for a term.
KeyMaker()
Default constructor.
Definition: keymaker.h:51
PositionIterator(const PositionIterator &o)
Copy constructor.
void add_boolean_term(const std::string &term)
Add a boolean filter term to the document.
Definition: document.h:191
double get_sumpart(Xapian::termcount wdf, Xapian::termcount doclen, Xapian::termcount uniqterms) const
Calculate the weight contribution for this object's term to a document.
void add_boolean_prefix(const std::string &field, Xapian::FieldProcessor *proc, const std::string *grouping=NULL)
Register a FieldProcessor for a boolean prefix.
Indicates a problem communicating with a remote database.
Definition: error.h:803
static std::string get_available_languages()
Return a list of available languages.
Definition: stem.h:181
std::string get_description() const
Return a string describing this object.
std::string get_description() const
Return a string describing this object.