xapian-core  2.0.0
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Xapian Namespace Reference

The Xapian namespace contains public interfaces for the Xapian library. More...

Namespaces

 Internal
 
 Remote
 Database factory functions for the remote backend.
 
 Unicode
 Functions associated with handling Unicode characters.
 

Classes

struct  ReplicationInfo
 Information about the steps involved in performing a replication. More...
 
class  DatabaseMaster
 Access to a master database for replication. More...
 
class  DatabaseReplica
 Access to a database replica, for applying replication to it. More...
 
class  Vec
 Suitable for "simple" type T. More...
 
class  SmallVector_
 
class  SmallVectorI
 Vector of Xapian PIMPL internal objects. More...
 
class  SmallVector
 Vector of Xapian PIMPL objects. More...
 
class  DatabaseReplicator
 Base class for database replicator objects. More...
 
class  BitWriter
 Create a stream to which non-byte-aligned values can be written. More...
 
class  BitReader
 Read a stream created by BitWriter. More...
 
class  StemStopper
 Stopper subclass which checks for both stemmed and unstemmed stopwords. More...
 
class  DocumentSet
 Class representing a set of documents in a cluster. More...
 
class  FreqSource
 Base class for TermListGroup Stores and provides terms that are contained in a document and their respective term frequencies. More...
 
class  TermListGroup
 A class for construction of termlists which store the terms for a document along with the number of documents it indexes i.e. More...
 
class  PointType
 Abstract class representing a point in the VSM. More...
 
class  Point
 Class to represent a document as a point in the Vector Space Model. More...
 
class  Centroid
 Class to represent cluster centroids in the vector space. More...
 
class  Cluster
 Class to represents a Cluster which contains Points and Centroid of the Cluster. More...
 
class  ClusterSet
 Class for storing the results returned by the Clusterer. More...
 
class  Similarity
 Base class for calculating the similarity between documents. More...
 
class  CosineDistance
 Class for calculating the cosine distance between two documents. More...
 
class  Clusterer
 Class representing an abstract class for a clusterer to be implemented. More...
 
class  KMeans
 Kmeans clusterer: This clusterer implements the K-Means clustering algorithm. More...
 
class  LCDClusterer
 LCD clusterer: This clusterer implements the LCD clustering algorithm adapted from Modelling efficient novelty-based search result diversification in metric spaces Gil-Costa et al. More...
 
class  Compactor
 Compact a database, or merge and compact several. More...
 
class  Database
 An indexed database of documents. More...
 
class  WritableDatabase
 This class provides read/write access to a database. More...
 
class  DerefWrapper_
 
class  Document
 Class representing a document. More...
 
class  Enquire
 Querying session. More...
 
class  Error
 All exceptions thrown by Xapian are subclasses of Xapian::Error. More...
 
class  LogicError
 The base class for exceptions indicating errors in the program logic. More...
 
class  RuntimeError
 The base class for exceptions indicating errors only detectable at runtime. More...
 
class  AssertionError
 AssertionError is thrown if a logical assertion inside Xapian fails. More...
 
class  InvalidArgumentError
 InvalidArgumentError indicates an invalid parameter value was passed to the API. More...
 
class  InvalidOperationError
 InvalidOperationError indicates the API was used in an invalid way. More...
 
class  UnimplementedError
 UnimplementedError indicates an attempt to use an unimplemented feature. More...
 
class  DatabaseError
 DatabaseError indicates some sort of database related error. More...
 
class  DatabaseCorruptError
 DatabaseCorruptError indicates database corruption was detected. More...
 
class  DatabaseCreateError
 DatabaseCreateError indicates a failure to create a database. More...
 
class  DatabaseLockError
 DatabaseLockError indicates failure to lock a database. More...
 
class  DatabaseModifiedError
 DatabaseModifiedError indicates a database was modified. More...
 
class  DatabaseOpeningError
 DatabaseOpeningError indicates failure to open a database. More...
 
class  DatabaseVersionError
 DatabaseVersionError indicates that a database is in an unsupported format. More...
 
class  DocNotFoundError
 Indicates an attempt to access a document not present in the database. More...
 
class  FeatureUnavailableError
 Indicates an attempt to use a feature which is unavailable. More...
 
class  InternalError
 InternalError indicates a runtime problem of some sort. More...
 
class  NetworkError
 Indicates a problem communicating with a remote database. More...
 
class  NetworkTimeoutError
 Indicates a timeout expired while communicating with a remote database. More...
 
class  QueryParserError
 Indicates a query string can't be parsed. More...
 
class  SerialisationError
 Indicates an error in the std::string serialisation of an object. More...
 
class  RangeError
 RangeError indicates an attempt to access outside the bounds of a container. More...
 
class  WildcardError
 WildcardError indicates an error expanding a wildcarded query. More...
 
class  DatabaseNotFoundError
 Indicates an attempt to access a database not present. More...
 
class  DatabaseClosedError
 Indicates an attempt to access a closed database. More...
 
class  ESet
 Class representing a list of search results. More...
 
class  ESetIterator
 Iterator over a Xapian::ESet. More...
 
class  ExpandDecider
 Virtual base class for expand decider functor. More...
 
class  ExpandDeciderAnd
 ExpandDecider subclass which rejects terms using two ExpandDeciders. More...
 
class  ExpandDeciderFilterTerms
 ExpandDecider subclass which rejects terms in a specified list. More...
 
class  ExpandDeciderFilterPrefix
 ExpandDecider subclass which restrict terms to a particular prefix. More...
 
struct  LatLongCoord
 A latitude-longitude coordinate. More...
 
class  LatLongCoordsIterator
 An iterator across the values in a LatLongCoords object. More...
 
class  LatLongCoords
 A sequence of latitude-longitude coordinates. More...
 
class  LatLongMetric
 Base class for calculating distances between two lat/long coordinates. More...
 
class  GreatCircleMetric
 Calculate the great-circle distance between two coordinates on a sphere. More...
 
class  LatLongDistancePostingSource
 Posting source which returns a weight based on geospatial distance. More...
 
class  LatLongDistanceKeyMaker
 KeyMaker subclass which sorts by distance from a latitude/longitude. More...
 
class  KeyMaker
 Virtual base class for key making functors. More...
 
class  MultiValueKeyMaker
 KeyMaker subclass which combines several values. More...
 
class  MatchDecider
 Abstract base class for match deciders. More...
 
class  MatchSpy
 Abstract base class for match spies. More...
 
class  ValueCountMatchSpy
 Class for counting the frequencies of values in the matching documents. More...
 
class  MSet
 Class representing a list of search results. More...
 
class  MSetIterator
 Iterator over a Xapian::MSet. More...
 
class  PositionIterator
 Class for iterating over term positions. More...
 
class  PostingIterator
 Class for iterating over a list of terms. More...
 
class  PostingSource
 Base class which provides an "external" source of postings. More...
 
class  ValuePostingSource
 A posting source which generates weights from a value slot. More...
 
class  ValueWeightPostingSource
 A posting source which reads weights from a value slot. More...
 
class  DecreasingValueWeightPostingSource
 Read weights from a value which is known to decrease as docid increases. More...
 
class  ValueMapPostingSource
 A posting source which looks up weights in a map using values as the key. More...
 
class  FixedWeightPostingSource
 A posting source which returns a fixed weight for all documents. More...
 
class  Query
 Class representing a query. More...
 
class  InvertedQuery_
 
class  Stopper
 Abstract base class for stop-word decision functor. More...
 
class  SimpleStopper
 Simple implementation of Stopper class - this will suit most users. More...
 
class  RangeProcessor
 Base class for range processors. More...
 
class  DateRangeProcessor
 Handle a date range. More...
 
class  NumberRangeProcessor
 Handle a number range. More...
 
class  UnitRangeProcessor
 Handle a byte unit range. More...
 
class  FieldProcessor
 Base class for field processors. More...
 
class  QueryParser
 Build a Xapian::Query object from a user query string. More...
 
class  Registry
 Registry for user subclasses. More...
 
class  RSet
 Class representing a set of documents judged as relevant. More...
 
class  StemImplementation
 Class representing a stemming algorithm implementation. More...
 
class  Stem
 Class representing a stemming algorithm. More...
 
class  TermGenerator
 Parses a piece of text and generate terms. More...
 
class  TermIterator
 Class for iterating over a list of terms. More...
 
class  Utf8Iterator
 An iterator which returns Unicode character values from a UTF-8 encoded string. More...
 
class  ValueIterator
 Class for iterating over document values. More...
 
class  ValueSetMatchDecider
 MatchDecider filtering results based on whether document values are in a user-defined set. More...
 
class  Weight
 Abstract base class for weighting schemes. More...
 
class  BoolWeight
 Class implementing a "boolean" weighting scheme. More...
 
class  TfIdfWeight
 Xapian::Weight subclass implementing the tf-idf weighting scheme. More...
 
class  BM25Weight
 Xapian::Weight subclass implementing the BM25 probabilistic formula. More...
 
class  BM25PlusWeight
 Xapian::Weight subclass implementing the BM25+ probabilistic formula. More...
 
class  TradWeight
 Xapian::Weight subclass implementing the traditional probabilistic formula. More...
 
class  InL2Weight
 This class implements the InL2 weighting scheme. More...
 
class  IfB2Weight
 This class implements the IfB2 weighting scheme. More...
 
class  IneB2Weight
 This class implements the IneB2 weighting scheme. More...
 
class  BB2Weight
 This class implements the BB2 weighting scheme. More...
 
class  DLHWeight
 This class implements the DLH weighting scheme, which is a representative scheme of the Divergence from Randomness Framework by Gianni Amati. More...
 
class  PL2Weight
 This class implements the PL2 weighting scheme. More...
 
class  PL2PlusWeight
 Xapian::Weight subclass implementing the PL2+ probabilistic formula. More...
 
class  DPHWeight
 This class implements the DPH weighting scheme. More...
 
class  LMJMWeight
 Language Model weighting with Jelinek-Mercer smoothing. More...
 
class  LMDirichletWeight
 Language Model weighting with Dirichlet or Dir+ smoothing. More...
 
class  LMAbsDiscountWeight
 Language Model weighting with Absolute Discount smoothing. More...
 
class  LM2StageWeight
 Language Model weighting with Two Stage smoothing. More...
 
class  CoordWeight
 Xapian::Weight subclass implementing Coordinate Matching. More...
 
class  DiceWeight
 Xapian::Weight subclass implementing Dice Coefficient. More...
 
struct  RangeProc
 
struct  Sniplet
 
class  SnipPipe
 

Typedefs

typedef SmallVector< QueryQueryVector
 
template<typename T >
using VecCOW = Vec< T, true >
 
template<typename T >
using VecUniquePtr = Vec< T *, false, true >
 
typedef unsigned XAPIAN_DOCID_BASE_TYPE doccount
 A count of documents. More...
 
typedef XAPIAN_DOCID_BASE_TYPE doccount_diff
 A signed difference between two counts of documents. More...
 
typedef unsigned XAPIAN_DOCID_BASE_TYPE docid
 A unique identifier for a document. More...
 
typedef double doclength
 A normalised document length. More...
 
typedef unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
 A counts of terms. More...
 
typedef XAPIAN_TERMCOUNT_BASE_TYPE termcount_diff
 A signed difference between two counts of terms. More...
 
typedef unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
 A term position within a document or query. More...
 
typedef XAPIAN_TERMPOS_BASE_TYPE termpos_diff
 A signed difference between two term positions. More...
 
typedef unsigned valueno
 The number for a value slot in a document. More...
 
typedef int valueno_diff
 A signed difference between two value slot numbers. More...
 
typedef XAPIAN_REVISION_TYPE rev
 Revision number of a database. More...
 
typedef XAPIAN_TOTALLENGTH_TYPE totallength
 The total length of all documents in a database. More...
 

Enumerations

enum  { RP_SUFFIX = 1 , RP_REPEATED = 2 , RP_DATE_PREFER_MDY = 4 }
 

Functions

static void throw_unimplemented (const char *message)
 
static bool decode_xxy (const string &s, int &x1, int &x2, int &y)
 
static bool vet_dm (int d, int m)
 
static bool is_yyyy_mm_dd (const string &s)
 
static void format_int_fixed_width (char *p, int v, int w)
 
static void format_yyyymmdd (char *p, int y, int m, int d)
 
static double check_byte_unit (const string &s)
 
static void invalid_operation (const char *msg)
 
static void reconstruct_open_poslists (TermList *termlist, Xapian::termpos start_pos, Xapian::termpos end_pos, string_view end, vector< unique_ptr< Pos >> &heap, size_t prefix_size=0)
 
static size_t check_stub (const string &stub_path, int opts, std::ostream *out)
 
static void open_stub (Database &db, string_view file)
 
static void open_stub (WritableDatabase &db, string_view file, int flags)
 
static Database::Internaldatabase_factory (int fd, int flags)
 Helper factory function. More...
 
template<typename T , typename U >
static constexpr T safe_shl (T x, U shift)
 Shift left that's safe for shifts wider than the type. More...
 
static TermListbuild_termlist_tree (const Xapian::Database &db, const RSet &rset)
 Build a tree of binary TermList objects like QueryOptimiser does for OrPostList objects. More...
 
bool operator== (const ESetIterator &a, const ESetIterator &b) noexcept
 Equality test for ESetIterator objects. More...
 
bool operator!= (const ESetIterator &a, const ESetIterator &b) noexcept
 Inequality test for ESetIterator objects. More...
 
bool operator< (const ESetIterator &a, const ESetIterator &b) noexcept
 Inequality test for ESetIterator objects. More...
 
bool operator> (const ESetIterator &a, const ESetIterator &b) noexcept
 Inequality test for ESetIterator objects. More...
 
bool operator>= (const ESetIterator &a, const ESetIterator &b) noexcept
 Inequality test for ESetIterator objects. More...
 
bool operator<= (const ESetIterator &a, const ESetIterator &b) noexcept
 Inequality test for ESetIterator objects. More...
 
ESetIterator operator+ (ESetIterator::difference_type n, const ESetIterator &it)
 Return ESetIterator it incremented by n positions. More...
 
double miles_to_metres (double miles) noexcept
 Convert from miles to metres. More...
 
double metres_to_miles (double metres) noexcept
 Convert from metres to miles. More...
 
bool operator!= (const LatLongCoordsIterator &a, const LatLongCoordsIterator &b)
 Inequality test for LatLongCoordsIterator objects. More...
 
bool iterator_valid (const Xapian::ESetIterator &it)
 
bool iterator_valid (const Xapian::MSetIterator &it)
 
void iterator_rewind (Xapian::ESetIterator &it)
 
void iterator_rewind (Xapian::MSetIterator &it)
 
bool iterator_rewound (Xapian::ESetIterator &it)
 
bool iterator_rewound (Xapian::MSetIterator &it)
 
bool iterator_valid (const Xapian::PositionIterator &it)
 
bool iterator_valid (const Xapian::PostingIterator &it)
 
bool iterator_valid (const Xapian::TermIterator &it)
 
bool iterator_valid (const Xapian::ValueIterator &it)
 
bool iterator_valid (const Xapian::Utf8Iterator &it)
 
bool operator== (const MSetIterator &a, const MSetIterator &b) noexcept
 Equality test for MSetIterator objects. More...
 
bool operator!= (const MSetIterator &a, const MSetIterator &b) noexcept
 Inequality test for MSetIterator objects. More...
 
bool operator< (const MSetIterator &a, const MSetIterator &b) noexcept
 Inequality test for MSetIterator objects. More...
 
bool operator> (const MSetIterator &a, const MSetIterator &b) noexcept
 Inequality test for MSetIterator objects. More...
 
bool operator>= (const MSetIterator &a, const MSetIterator &b) noexcept
 Inequality test for MSetIterator objects. More...
 
bool operator<= (const MSetIterator &a, const MSetIterator &b) noexcept
 Inequality test for MSetIterator objects. More...
 
MSetIterator operator+ (MSetIterator::difference_type n, const MSetIterator &it)
 Return MSetIterator it incremented by n positions. More...
 
bool operator== (const PositionIterator &a, const PositionIterator &b) noexcept
 Equality test for PositionIterator objects. More...
 
bool operator!= (const PositionIterator &a, const PositionIterator &b) noexcept
 Inequality test for PositionIterator objects. More...
 
bool operator== (const PostingIterator &a, const PostingIterator &b) noexcept
 Equality test for PostingIterator objects. More...
 
bool operator!= (const PostingIterator &a, const PostingIterator &b) noexcept
 Inequality test for PostingIterator objects. More...
 
const Query operator& (const Query &a, const Query &b)
 Combine two Xapian::Query objects using OP_AND. More...
 
const Query operator| (const Query &a, const Query &b)
 Combine two Xapian::Query objects using OP_OR. More...
 
const Query operator^ (const Query &a, const Query &b)
 Combine two Xapian::Query objects using OP_XOR. More...
 
const Query operator* (double factor, const Query &q)
 Scale a Xapian::Query object using OP_SCALE_WEIGHT. More...
 
const Query operator* (const Query &q, double factor)
 Scale a Xapian::Query object using OP_SCALE_WEIGHT. More...
 
const Query operator/ (const Query &q, double factor)
 Inverse-scale a Xapian::Query object using OP_SCALE_WEIGHT. More...
 
const Query operator& (const Query &a, const InvertedQuery_ &b)
 Combine two Xapian::Query objects using OP_AND_NOT. More...
 
const Query operator&= (Query &a, const InvertedQuery_ &b)
 Combine two Xapian::Query objects using OP_AND_NOT with result in the first. More...
 
size_t sortable_serialise_ (double value, char *buf) noexcept
 
std::string sortable_serialise (double value)
 Convert a floating point number to a string, preserving sort order. More...
 
double sortable_unserialise (std::string_view serialised) noexcept
 Convert a string encoded using sortable_serialise back to a floating point number. More...
 
bool operator== (const TermIterator &a, const TermIterator &b) noexcept
 Equality test for TermIterator objects. More...
 
bool operator!= (const TermIterator &a, const TermIterator &b) noexcept
 Inequality test for TermIterator objects. More...
 
bool operator== (const ValueIterator &a, const ValueIterator &b) noexcept
 Equality test for ValueIterator objects. More...
 
bool operator!= (const ValueIterator &a, const ValueIterator &b) noexcept
 Inequality test for ValueIterator objects. More...
 
const char * version_string ()
 Report the version string of the library which the program is linked with. More...
 
int major_version ()
 Report the major version of the library which the program is linked with. More...
 
int minor_version ()
 Report the minor version of the library which the program is linked with. More...
 
int revision ()
 Report the revision of the library which the program is linked with. More...
 
static bool U_isupper (unsigned ch)
 
static unsigned check_wordchar (unsigned ch)
 
static bool should_stem (const std::string &term)
 
static unsigned check_infix (unsigned ch)
 
static unsigned check_infix_digit (unsigned ch)
 
static bool is_digit (unsigned ch)
 
static unsigned check_suffix (unsigned ch)
 
template<typename ACTION >
static bool break_words (Utf8Iterator &itor, unsigned break_flags, bool with_positions, ACTION action)
 
template<typename ACTION >
static void parse_terms (Utf8Iterator itor, unsigned break_flags, bool with_positions, ACTION action)
 Templated framework for processing terms. More...
 
static bool snippet_check_leading_nonwordchar (unsigned ch)
 
static bool snippet_check_trailing_nonwordchar (unsigned ch)
 
static void append_escaping_xml (const char *p, const char *end, string &output)
 
static void check_query (const Xapian::Query &query, list< vector< string >> &exact_phrases, unordered_map< string, double > &loose_terms, list< const Xapian::Internal::QueryWildcard * > &wildcards, list< const Xapian::Internal::QueryEditDistance * > &fuzzies, size_t &longest_phrase)
 
static double * check_term (unordered_map< string, double > &loose_terms, const Xapian::Weight::Internal *stats, const string &term, double max_tw)
 
static double stirling_value (double difference, double y, double stirling_constant)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const char *params)
 
static TfIdfWeight::wdf_norm decode_wdf_norm (const string &normalizations)
 
static TfIdfWeight::idf_norm decode_idf_norm (const string &normalizations)
 
static TfIdfWeight::wt_norm decode_wt_norm (const string &normalizations)
 
static void parameter_error (const char *message, const char *params)
 
static void parameter_error (const char *message, const string &scheme, const char *params)
 

Variables

static constexpr unsigned char KEYSPEC_REVERSE = 1
 
static constexpr unsigned char KEYSPEC_DEFVALUE = 2
 
static const char max_month_length [12]
 
static const char byte_units [4][2]
 
const int DB_CREATE_OR_OPEN = 0x00
 Create database if it doesn't already exist. More...
 
const int DB_CREATE_OR_OVERWRITE = 0x01
 Create database if it doesn't already exist, or overwrite if it does. More...
 
const int DB_CREATE = 0x02
 Create a new database. More...
 
const int DB_OPEN = 0x03
 Open an existing database. More...
 
const int DB_NO_SYNC = 0x04
 Don't attempt to ensure changes have hit disk. More...
 
const int DB_FULL_SYNC = 0x08
 Try to ensure changes are really written to disk. More...
 
const int DB_DANGEROUS = 0x10
 Update the database in-place. More...
 
const int DB_NO_TERMLIST = 0x20
 When creating a database, don't create a termlist table. More...
 
const int DB_RETRY_LOCK = 0x40
 If the database is already locked, retry the lock. More...
 
const int DB_BACKEND_GLASS = 0x100
 Use the glass backend. More...
 
const int DB_BACKEND_STUB = 0x300
 Open a stub database file. More...
 
const int DB_BACKEND_INMEMORY = 0x400
 Use the "in memory" backend. More...
 
const int DB_BACKEND_HONEY = 0x500
 Use the honey backend. More...
 
const int DBCHECK_SHORT_TREE = 1
 Show a short-format display of the B-tree contents. More...
 
const int DBCHECK_FULL_TREE = 2
 Show a full display of the B-tree contents. More...
 
const int DBCHECK_SHOW_FREELIST = 4
 Show the bitmap for the B-tree. More...
 
const int DBCHECK_SHOW_STATS = 8
 Show statistics for the B-tree. More...
 
const int DBCHECK_FIX = 16
 Fix problems. More...
 
const int DBCOMPACT_NO_RENUMBER = 4
 Use the same document ids in the output as in the input(s). More...
 
const int DBCOMPACT_MULTIPASS = 8
 If merging more than 3 databases, merge the postlists in multiple passes. More...
 
const int DBCOMPACT_SINGLE_FILE = 16
 Produce a single-file database. More...
 
const int DOC_ASSUME_VALID = 1
 Assume document id is valid. More...
 
const valueno BAD_VALUENO = 0xffffffff
 Reserved value to indicate "no valueno". More...
 
static const unsigned UNICODE_IGNORE = numeric_limits<unsigned>::max()
 Value representing "ignore this" when returned by check_infix() or check_infix_digit(). More...
 

Detailed Description

The Xapian namespace contains public interfaces for the Xapian library.

Typedef Documentation

◆ doccount

A count of documents.

This is used to hold values such as the number of documents in a database and the frequency of a term in the database.

Definition at line 37 of file types.h.

◆ doccount_diff

A signed difference between two counts of documents.

This is used by the Xapian classes which are STL containers of documents for "difference_type".

Definition at line 44 of file types.h.

◆ docid

A unique identifier for a document.

Docid 0 is invalid, providing an "out of range" value which can be used to mean "not a valid document".

Definition at line 51 of file types.h.

◆ doclength

typedef double Xapian::doclength

A normalised document length.

The normalised document length is the document length divided by the average document length in the database.

Definition at line 58 of file types.h.

◆ QueryVector

Definition at line 32 of file queryvector.h.

◆ rev

Revision number of a database.

For databases which support this, it increases with each commit.

Experimental - see https://xapian.org/docs/deprecation#experimental-features

Definition at line 108 of file types.h.

◆ termcount

A counts of terms.

This is used to hold values such as the Within Document Frequency (wdf).

Definition at line 64 of file types.h.

◆ termcount_diff

A signed difference between two counts of terms.

This is used by the Xapian classes which are STL containers of terms for "difference_type".

Definition at line 71 of file types.h.

◆ termpos

A term position within a document or query.

Definition at line 75 of file types.h.

◆ termpos_diff

A signed difference between two term positions.

This is used by the Xapian classes which are STL containers of positions for "difference_type".

Definition at line 82 of file types.h.

◆ totallength

The total length of all documents in a database.

Since
Added in Xapian 1.4.5.

Definition at line 114 of file types.h.

◆ valueno

typedef unsigned Xapian::valueno

The number for a value slot in a document.

Value slot numbers are unsigned and (currently) a 32-bit quantity, with Xapian::BAD_VALUENO being represented by the largest possible value. Therefore value slots 0 to 0xFFFFFFFE are available for use.

Definition at line 90 of file types.h.

◆ valueno_diff

typedef int Xapian::valueno_diff

A signed difference between two value slot numbers.

This is used by the Xapian classes which are STL containers of values for "difference_type".

Definition at line 97 of file types.h.

◆ VecCOW

template<typename T >
using Xapian::VecCOW = typedef Vec<T, true>

Definition at line 408 of file smallvector.h.

◆ VecUniquePtr

template<typename T >
using Xapian::VecUniquePtr = typedef Vec<T*, false, true>

Definition at line 411 of file smallvector.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
RP_SUFFIX 
RP_REPEATED 
RP_DATE_PREFER_MDY 

Definition at line 132 of file queryparser.h.

Function Documentation

◆ append_escaping_xml()

static void Xapian::append_escaping_xml ( const char *  p,
const char *  end,
string &  output 
)
inlinestatic

Definition at line 590 of file termgenerator_internal.cc.

References p.

Referenced by Xapian::SnipPipe::drain().

◆ break_words()

template<typename ACTION >
static bool Xapian::break_words ( Utf8Iterator itor,
unsigned  break_flags,
bool  with_positions,
ACTION  action 
)
static

◆ build_termlist_tree()

static TermList* Xapian::build_termlist_tree ( const Xapian::Database db,
const RSet rset 
)
static

Build a tree of binary TermList objects like QueryOptimiser does for OrPostList objects.

Definition at line 66 of file esetinternal.cc.

References Assert, Xapian::RSet::empty(), Xapian::Database::internal, Xapian::RSet::internal, make_termlist_merger(), and p.

Referenced by Xapian::ESet::Internal::expand().

◆ check_byte_unit()

static double Xapian::check_byte_unit ( const string &  s)
static

Definition at line 331 of file valuerangeproc.cc.

References byte_units, and endswith().

Referenced by Xapian::UnitRangeProcessor::operator()().

◆ check_infix()

static unsigned Xapian::check_infix ( unsigned  ch)
inlinestatic

Definition at line 82 of file termgenerator_internal.cc.

References UNICODE_IGNORE.

◆ check_infix_digit()

static unsigned Xapian::check_infix_digit ( unsigned  ch)
inlinestatic

Definition at line 105 of file termgenerator_internal.cc.

References UNICODE_IGNORE.

◆ check_query()

static void Xapian::check_query ( const Xapian::Query query,
list< vector< string >> &  exact_phrases,
unordered_map< string, double > &  loose_terms,
list< const Xapian::Internal::QueryWildcard * > &  wildcards,
list< const Xapian::Internal::QueryEditDistance * > &  fuzzies,
size_t &  longest_phrase 
)
static

◆ check_stub()

static size_t Xapian::check_stub ( const string &  stub_path,
int  opts,
std::ostream *  out 
)
static

Definition at line 419 of file dbcheck.cc.

References opts, and read_stub_file().

Referenced by Xapian::Database::check_().

◆ check_suffix()

static unsigned Xapian::check_suffix ( unsigned  ch)
inlinestatic

Definition at line 133 of file termgenerator_internal.cc.

Referenced by parse_terms().

◆ check_term()

static double* Xapian::check_term ( unordered_map< string, double > &  loose_terms,
const Xapian::Weight::Internal stats,
const string &  term,
double  max_tw 
)
static

◆ check_wordchar()

static unsigned Xapian::check_wordchar ( unsigned  ch)
inlinestatic

Definition at line 58 of file termgenerator_internal.cc.

References Xapian::Unicode::is_wordchar(), and Xapian::Unicode::tolower().

Referenced by parse_terms().

◆ database_factory()

static Database::Internal* Xapian::database_factory ( int  fd,
int  flags 
)
static

Helper factory function.

This allows us to initialise Database::internal via the constructor's initialiser list, which we want to be able to do as Database::internal is an intrusive_ptr_nonnull, so we can't set it to NULL in the initialiser list and then fill it in later in the constructor body.

Definition at line 296 of file dbfactory.cc.

References BACKEND_GLASS, BACKEND_HONEY, close(), DB_BACKEND_GLASS, DB_BACKEND_HONEY, rare, and test_if_single_file_db().

◆ decode_idf_norm()

static TfIdfWeight::idf_norm Xapian::decode_idf_norm ( const string &  normalizations)
static

Definition at line 70 of file tfidfweight.cc.

References NONE.

◆ decode_wdf_norm()

static TfIdfWeight::wdf_norm Xapian::decode_wdf_norm ( const string &  normalizations)
static

Definition at line 44 of file tfidfweight.cc.

References BOOLEAN, and NONE.

◆ decode_wt_norm()

static TfIdfWeight::wt_norm Xapian::decode_wt_norm ( const string &  normalizations)
static

Definition at line 92 of file tfidfweight.cc.

References NONE.

◆ decode_xxy()

static bool Xapian::decode_xxy ( const string &  s,
int &  x1,
int &  x2,
int &  y 
)
static

Definition at line 40 of file valuerangeproc.cc.

References C_isdigit(), and p.

Referenced by Xapian::DateRangeProcessor::operator()().

◆ format_int_fixed_width()

static void Xapian::format_int_fixed_width ( char *  p,
int  v,
int  w 
)
static

Definition at line 106 of file valuerangeproc.cc.

References p.

Referenced by format_yyyymmdd().

◆ format_yyyymmdd()

static void Xapian::format_yyyymmdd ( char *  p,
int  y,
int  m,
int  d 
)
static

Definition at line 115 of file valuerangeproc.cc.

References format_int_fixed_width(), and p.

Referenced by Xapian::DateRangeProcessor::operator()().

◆ invalid_operation()

static void Xapian::invalid_operation ( const char *  msg)
static

Definition at line 46 of file databaseinternal.cc.

◆ is_digit()

static bool Xapian::is_digit ( unsigned  ch)
inlinestatic

◆ is_yyyy_mm_dd()

static bool Xapian::is_yyyy_mm_dd ( const string &  s)
static

Definition at line 90 of file valuerangeproc.cc.

Referenced by Xapian::DateRangeProcessor::operator()().

◆ iterator_rewind() [1/2]

void Xapian::iterator_rewind ( Xapian::ESetIterator it)
inline

Rewind iterator.

Definition at line 56 of file iterator.h.

References Xapian::ESetIterator::eset, Xapian::ESetIterator::off_from_end, and Xapian::ESet::size().

◆ iterator_rewind() [2/2]

void Xapian::iterator_rewind ( Xapian::MSetIterator it)
inline

Rewind iterator.

Definition at line 61 of file iterator.h.

References Xapian::MSetIterator::mset, Xapian::MSetIterator::off_from_end, and Xapian::MSet::size().

◆ iterator_rewound() [1/2]

bool Xapian::iterator_rewound ( Xapian::ESetIterator it)
inline

Is the iterator at the start?

Definition at line 66 of file iterator.h.

References Xapian::ESetIterator::eset, Xapian::ESetIterator::off_from_end, and Xapian::ESet::size().

◆ iterator_rewound() [2/2]

bool Xapian::iterator_rewound ( Xapian::MSetIterator it)
inline

Is the iterator at the start?

Definition at line 71 of file iterator.h.

References Xapian::MSetIterator::mset, Xapian::MSetIterator::off_from_end, and Xapian::MSet::size().

◆ iterator_valid() [1/7]

bool Xapian::iterator_valid ( const Xapian::ESetIterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 46 of file iterator.h.

References Xapian::ESetIterator::off_from_end.

Referenced by Pos::next().

◆ iterator_valid() [2/7]

bool Xapian::iterator_valid ( const Xapian::MSetIterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 51 of file iterator.h.

References Xapian::MSetIterator::off_from_end.

◆ iterator_valid() [3/7]

bool Xapian::iterator_valid ( const Xapian::PositionIterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 76 of file iterator.h.

References Xapian::PositionIterator::internal.

◆ iterator_valid() [4/7]

bool Xapian::iterator_valid ( const Xapian::PostingIterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 81 of file iterator.h.

References Xapian::PostingIterator::internal.

◆ iterator_valid() [5/7]

bool Xapian::iterator_valid ( const Xapian::TermIterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 86 of file iterator.h.

References Xapian::TermIterator::internal.

◆ iterator_valid() [6/7]

bool Xapian::iterator_valid ( const Xapian::Utf8Iterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 96 of file iterator.h.

◆ iterator_valid() [7/7]

bool Xapian::iterator_valid ( const Xapian::ValueIterator it)
inline

Determine if iterator is valid to dereference.

Definition at line 91 of file iterator.h.

References Xapian::ValueIterator::internal.

◆ major_version()

int Xapian::major_version ( )
inline

Report the major version of the library which the program is linked with.

This may be different to the version compiled against (given by XAPIAN_MAJOR_VERSION) if shared libraries are being used.

Definition at line 128 of file xapian.h.

References Xapian::Internal::get_constinfo_(), and Xapian::Internal::constinfo::major.

Referenced by DEFINE_TESTCASE().

◆ metres_to_miles()

double Xapian::metres_to_miles ( double  metres)
inlinenoexcept

Convert from metres to miles.

Experimental - see https://xapian.org/docs/deprecation#experimental-features

Definition at line 67 of file geospatial.h.

◆ miles_to_metres()

double Xapian::miles_to_metres ( double  miles)
inlinenoexcept

Convert from miles to metres.

Experimental - see https://xapian.org/docs/deprecation#experimental-features

Definition at line 54 of file geospatial.h.

◆ minor_version()

int Xapian::minor_version ( )
inline

Report the minor version of the library which the program is linked with.

This may be different to the version compiled against (given by XAPIAN_MINOR_VERSION) if shared libraries are being used.

Definition at line 137 of file xapian.h.

References Xapian::Internal::get_constinfo_(), and Xapian::Internal::constinfo::minor.

Referenced by DEFINE_TESTCASE().

◆ open_stub() [1/2]

static void Xapian::open_stub ( Database db,
string_view  file 
)
static

◆ open_stub() [2/2]

static void Xapian::open_stub ( WritableDatabase db,
string_view  file,
int  flags 
)
static

◆ operator!=() [1/7]

bool Xapian::operator!= ( const ESetIterator a,
const ESetIterator b 
)
inlinenoexcept

Inequality test for ESetIterator objects.

Definition at line 278 of file eset.h.

Referenced by Xapian::Enquire::Internal::get_matching_terms_begin().

◆ operator!=() [2/7]

bool Xapian::operator!= ( const LatLongCoordsIterator a,
const LatLongCoordsIterator b 
)
inline

Inequality test for LatLongCoordsIterator objects.

Definition at line 293 of file geospatial.h.

◆ operator!=() [3/7]

bool Xapian::operator!= ( const MSetIterator a,
const MSetIterator b 
)
inlinenoexcept

Inequality test for MSetIterator objects.

Definition at line 728 of file mset.h.

◆ operator!=() [4/7]

bool Xapian::operator!= ( const PositionIterator a,
const PositionIterator b 
)
inlinenoexcept

Inequality test for PositionIterator objects.

Definition at line 146 of file positioniterator.h.

◆ operator!=() [5/7]

bool Xapian::operator!= ( const PostingIterator a,
const PostingIterator b 
)
inlinenoexcept

Inequality test for PostingIterator objects.

Definition at line 176 of file postingiterator.h.

◆ operator!=() [6/7]

bool Xapian::operator!= ( const TermIterator a,
const TermIterator b 
)
inlinenoexcept

Inequality test for TermIterator objects.

Definition at line 178 of file termiterator.h.

◆ operator!=() [7/7]

bool Xapian::operator!= ( const ValueIterator a,
const ValueIterator b 
)
inlinenoexcept

Inequality test for ValueIterator objects.

Definition at line 212 of file valueiterator.h.

◆ operator&() [1/2]

const Query Xapian::operator& ( const Query a,
const InvertedQuery_ b 
)
inline

Combine two Xapian::Query objects using OP_AND_NOT.

E.g. Xapian::Query q = q1 &~ q2;

Definition at line 882 of file query.h.

◆ operator&() [2/2]

const Query Xapian::operator& ( const Query a,
const Query b 
)
inline

Combine two Xapian::Query objects using OP_AND.

Definition at line 802 of file query.h.

References Xapian::Query::OP_AND.

◆ operator&=()

const Query Xapian::operator&= ( Query a,
const InvertedQuery_ b 
)
inline

Combine two Xapian::Query objects using OP_AND_NOT with result in the first.

E.g. q1 &=~ q2;

Definition at line 892 of file query.h.

◆ operator*() [1/2]

const Query Xapian::operator* ( const Query q,
double  factor 
)
inline

Scale a Xapian::Query object using OP_SCALE_WEIGHT.

Parameters
qXapian::Query object.
factorNon-negative real number to multiply weights by.

Definition at line 838 of file query.h.

◆ operator*() [2/2]

const Query Xapian::operator* ( double  factor,
const Query q 
)
inline

Scale a Xapian::Query object using OP_SCALE_WEIGHT.

Parameters
factorNon-negative real number to multiply weights by.
qXapian::Query object.

Definition at line 827 of file query.h.

Referenced by Xapian::Enquire::Internal::get_matching_terms_begin(), and Xapian::QueryParser::unstem_begin().

◆ operator+() [1/2]

ESetIterator Xapian::operator+ ( ESetIterator::difference_type  n,
const ESetIterator it 
)
inline

Return ESetIterator it incremented by n positions.

If n is negative, decrements by (-n) positions.

Definition at line 316 of file eset.h.

◆ operator+() [2/2]

MSetIterator Xapian::operator+ ( MSetIterator::difference_type  n,
const MSetIterator it 
)
inline

Return MSetIterator it incremented by n positions.

If n is negative, decrements by (-n) positions.

Definition at line 766 of file mset.h.

◆ operator/()

const Query Xapian::operator/ ( const Query q,
double  factor 
)
inline

Inverse-scale a Xapian::Query object using OP_SCALE_WEIGHT.

Parameters
factorPositive real number to divide weights by.
qXapian::Query object.

Definition at line 849 of file query.h.

◆ operator<() [1/2]

bool Xapian::operator< ( const ESetIterator a,
const ESetIterator b 
)
inlinenoexcept

Inequality test for ESetIterator objects.

Definition at line 284 of file eset.h.

◆ operator<() [2/2]

bool Xapian::operator< ( const MSetIterator a,
const MSetIterator b 
)
inlinenoexcept

Inequality test for MSetIterator objects.

Definition at line 734 of file mset.h.

◆ operator<=() [1/2]

bool Xapian::operator<= ( const ESetIterator a,
const ESetIterator b 
)
inlinenoexcept

Inequality test for ESetIterator objects.

Definition at line 305 of file eset.h.

◆ operator<=() [2/2]

bool Xapian::operator<= ( const MSetIterator a,
const MSetIterator b 
)
inlinenoexcept

Inequality test for MSetIterator objects.

Definition at line 755 of file mset.h.

◆ operator==() [1/6]

bool Xapian::operator== ( const ESetIterator a,
const ESetIterator b 
)
inlinenoexcept

Equality test for ESetIterator objects.

Definition at line 271 of file eset.h.

◆ operator==() [2/6]

bool Xapian::operator== ( const MSetIterator a,
const MSetIterator b 
)
inlinenoexcept

Equality test for MSetIterator objects.

Definition at line 721 of file mset.h.

◆ operator==() [3/6]

bool Xapian::operator== ( const PositionIterator a,
const PositionIterator b 
)
inlinenoexcept

Equality test for PositionIterator objects.

Definition at line 137 of file positioniterator.h.

◆ operator==() [4/6]

bool Xapian::operator== ( const PostingIterator a,
const PostingIterator b 
)
inlinenoexcept

Equality test for PostingIterator objects.

Definition at line 167 of file postingiterator.h.

◆ operator==() [5/6]

bool Xapian::operator== ( const TermIterator a,
const TermIterator b 
)
inlinenoexcept

Equality test for TermIterator objects.

Definition at line 169 of file termiterator.h.

◆ operator==() [6/6]

bool Xapian::operator== ( const ValueIterator a,
const ValueIterator b 
)
inlinenoexcept

Equality test for ValueIterator objects.

Definition at line 203 of file valueiterator.h.

◆ operator>() [1/2]

bool Xapian::operator> ( const ESetIterator a,
const ESetIterator b 
)
inlinenoexcept

Inequality test for ESetIterator objects.

Definition at line 292 of file eset.h.

◆ operator>() [2/2]

bool Xapian::operator> ( const MSetIterator a,
const MSetIterator b 
)
inlinenoexcept

Inequality test for MSetIterator objects.

Definition at line 742 of file mset.h.

◆ operator>=() [1/2]

bool Xapian::operator>= ( const ESetIterator a,
const ESetIterator b 
)
inlinenoexcept

Inequality test for ESetIterator objects.

Definition at line 299 of file eset.h.

◆ operator>=() [2/2]

bool Xapian::operator>= ( const MSetIterator a,
const MSetIterator b 
)
inlinenoexcept

Inequality test for MSetIterator objects.

Definition at line 749 of file mset.h.

◆ operator^()

const Query Xapian::operator^ ( const Query a,
const Query b 
)
inline

Combine two Xapian::Query objects using OP_XOR.

Definition at line 816 of file query.h.

References Xapian::Query::OP_XOR.

◆ operator|()

const Query Xapian::operator| ( const Query a,
const Query b 
)
inline

Combine two Xapian::Query objects using OP_OR.

Definition at line 809 of file query.h.

References Xapian::Query::OP_OR.

◆ parameter_error() [1/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

◆ parameter_error() [2/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 192 of file bm25plusweight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [3/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 236 of file bm25weight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [4/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 141 of file ifb2weight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [5/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 141 of file ineb2weight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [6/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 139 of file inl2weight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [7/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 191 of file pl2plusweight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [8/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 175 of file pl2weight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [9/10]

static void Xapian::parameter_error ( const char *  message,
const char *  params 
)
inlinestatic

Definition at line 344 of file tfidfweight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parameter_error() [10/10]

static void Xapian::parameter_error ( const char *  message,
const string &  scheme,
const char *  params 
)
inlinestatic

Definition at line 219 of file weight.cc.

References Xapian::Weight::Internal::parameter_error().

◆ parse_terms()

template<typename ACTION >
static void Xapian::parse_terms ( Utf8Iterator  itor,
unsigned  break_flags,
bool  with_positions,
ACTION  action 
)
static

Templated framework for processing terms.

Calls action(term, positional) for each term to add, where term is a std::string holding the term, and positional is a bool indicating if this term carries positional information.

Definition at line 189 of file termgenerator_internal.cc.

References Xapian::Unicode::append_utf8(), break_words(), check_infix(), check_infix_digit(), check_suffix(), check_wordchar(), is_digit(), is_unbroken_script(), is_unbroken_wordchar(), Xapian::Unicode::is_wordchar(), Xapian::Utf8Iterator::left(), p, term, Xapian::Unicode::tolower(), U_isupper(), and UNICODE_IGNORE.

Referenced by Xapian::TermGenerator::Internal::index_text(), and Xapian::MSet::Internal::snippet().

◆ reconstruct_open_poslists()

static void Xapian::reconstruct_open_poslists ( TermList termlist,
Xapian::termpos  start_pos,
Xapian::termpos  end_pos,
string_view  end,
vector< unique_ptr< Pos >> &  heap,
size_t  prefix_size = 0 
)
static

◆ revision()

int Xapian::revision ( )
inline

Report the revision of the library which the program is linked with.

This may be different to the version compiled against (given by XAPIAN_REVISION) if shared libraries are being used.

Definition at line 146 of file xapian.h.

References Xapian::Internal::get_constinfo_(), and Xapian::Internal::constinfo::revision.

Referenced by GlassFreeList::commit(), HoneyFreeList::commit(), GlassTable::commit(), DEFINE_TESTCASE(), GlassFreeList::mark_block_unused(), HoneyFreeList::mark_block_unused(), GlassDatabase::open_tables(), Xapian::DatabaseMaster::write_changesets_to_fd(), and GlassDatabase::write_changesets_to_fd().

◆ safe_shl()

template<typename T , typename U >
static constexpr T Xapian::safe_shl ( x,
shift 
)
inlinestaticconstexpr

Shift left that's safe for shifts wider than the type.

Definition at line 86 of file bitstream.cc.

Referenced by Xapian::BitReader::decode(), and Xapian::BitWriter::encode().

◆ should_stem()

static bool Xapian::should_stem ( const std::string &  term)
inlinestatic

◆ snippet_check_leading_nonwordchar()

static bool Xapian::snippet_check_leading_nonwordchar ( unsigned  ch)
inlinestatic

◆ snippet_check_trailing_nonwordchar()

static bool Xapian::snippet_check_trailing_nonwordchar ( unsigned  ch)
inlinestatic

◆ sortable_serialise()

std::string Xapian::sortable_serialise ( double  value)
inline

Convert a floating point number to a string, preserving sort order.

This method converts a floating point number to a string, suitable for using as a value for numeric range restriction, or for use as a sort key.

The conversion is platform independent.

The conversion attempts to ensure that, for any pair of values supplied to the conversion algorithm, the result of comparing the original values (with a numeric comparison operator) will be the same as the result of comparing the resulting values (with a string comparison operator). On platforms which represent doubles with the precisions specified by IEEE_754, this will be the case: if the representation of doubles is more precise, it is possible that two very close doubles will be mapped to the same string, so will compare equal.

Note also that both zero and -zero will be converted to the same representation: since these compare equal, this satisfies the comparison constraint, but it's worth knowing this if you wish to use the encoding in some situation where this distinction matters.

Handling of NaN isn't (currently) guaranteed to be sensible.

Parameters
valueThe number to serialise.

Definition at line 1229 of file queryparser.h.

References sortable_serialise_().

Referenced by DEFINE_TESTCASE(), gen_decvalwtsource3_db(), gen_decvalwtsource5_db(), gen_qp_range3_db(), gen_valueweightsource5_db(), FileIndexer::index_to(), Xapian::NumberRangeProcessor::operator()(), Xapian::UnitRangeProcessor::operator()(), Xapian::LatLongDistanceKeyMaker::operator()(), and test_sortableserialise1().

◆ sortable_serialise_()

size_t Xapian::sortable_serialise_ ( double  value,
char *  buf 
)
privatenoexcept

Helper for sortable_serialise().

Definition at line 49 of file sortable-serialise.cc.

References negate_unsigned(), rare, and UNITTEST_ASSERT_NOTHROW.

Referenced by sortable_serialise().

◆ sortable_unserialise()

double Xapian::sortable_unserialise ( std::string_view  serialised)
noexcept

Convert a string encoded using sortable_serialise back to a floating point number.

This expects the input to be a string produced by sortable_serialise(). If the input is not such a string, the value returned is undefined (but no error will be thrown).

The result of the conversion will be exactly the value which was supplied to sortable_serialise() when making the string on platforms which represent doubles with the precisions specified by IEEE_754, but may be a different (nearby) value on other platforms.

Parameters
serialisedThe serialised string to decode.

Definition at line 186 of file sortable-serialise.cc.

References negate_unsigned(), numfromstr(), and UNITTEST_ASSERT_NOTHROW.

Referenced by decode_and_show_value(), Xapian::ValueWeightPostingSource::get_weight(), Xapian::ValueWeightPostingSource::reset(), and test_sortableserialise1().

◆ stirling_value()

static double Xapian::stirling_value ( double  difference,
double  y,
double  stirling_constant 
)
static

Definition at line 38 of file bb2weight.cc.

Referenced by Xapian::BB2Weight::get_sumpart(), and Xapian::BB2Weight::init().

◆ throw_unimplemented()

static void Xapian::throw_unimplemented ( const char *  message)
static

◆ U_isupper()

static bool Xapian::U_isupper ( unsigned  ch)
inlinestatic

Definition at line 52 of file termgenerator_internal.cc.

◆ version_string()

const char* Xapian::version_string ( )
inline

Report the version string of the library which the program is linked with.

This may be different to the version compiled against (given by XAPIAN_VERSION) if shared libraries are being used.

Definition at line 119 of file xapian.h.

References Xapian::Internal::get_constinfo_(), and Xapian::Internal::constinfo::str.

Referenced by DEFINE_TESTCASE(), and PerfTestLogger::open().

◆ vet_dm()

static bool Xapian::vet_dm ( int  d,
int  m 
)
static

Definition at line 80 of file valuerangeproc.cc.

References max_month_length.

Referenced by Xapian::DateRangeProcessor::operator()().

Variable Documentation

◆ BAD_VALUENO

const valueno Xapian::BAD_VALUENO = 0xffffffff

◆ byte_units

const char Xapian::byte_units[4][2]
static
Initial value:
= {
"B", "K", "M", "G"
}

Definition at line 323 of file valuerangeproc.cc.

Referenced by check_byte_unit().

◆ DB_BACKEND_GLASS

const int Xapian::DB_BACKEND_GLASS = 0x100

Use the glass backend.

When opening a WritableDatabase, this means create a glass database if a new database is created. If there's an existing database (of any type) at the specified path, this flag has no effect.

When opening a Database, this flag means to only open it if it's a glass database. There's rarely a good reason to do this - it's mostly provided as equivalent functionality to that provided by the namespaced open() functions in Xapian 1.2.

Definition at line 157 of file constants.h.

Referenced by HoneyDatabase::compact(), Xapian::Database::compact_(), BackendManagerMulti::createdb_multi(), Xapian::Database::Database(), database_factory(), DEFINE_TESTCASE(), BackendManagerGlass::do_get_database_path(), BackendManagerHoney::do_get_database_path(), BackendManagerGlass::get_writable_database(), BackendManagerGlass::get_writable_database_again(), main(), open_stub(), and Xapian::WritableDatabase::WritableDatabase().

◆ DB_BACKEND_HONEY

const int Xapian::DB_BACKEND_HONEY = 0x500

Use the honey backend.

When opening a WritableDatabase, this means create a honey database if a new database is created. If there's an existing database (of any type) at the specified path, this flag has no effect.

When opening a Database, this flag means to only open it if it's a honey database. There's rarely a good reason to do this - it's mostly provided as equivalent functionality to that provided by the namespaced open() functions in Xapian 1.2.

Since
Added in Xapian 2.0.0.

Definition at line 197 of file constants.h.

Referenced by Xapian::Database::compact_(), Xapian::Database::Database(), database_factory(), DEFINE_TESTCASE(), BackendManagerHoney::do_get_database_path(), BackendManagerHoney::finalise_generated_database(), main(), and Xapian::WritableDatabase::WritableDatabase().

◆ DB_BACKEND_INMEMORY

const int Xapian::DB_BACKEND_INMEMORY = 0x400

Use the "in memory" backend.

The filename is currently ignored when this flag is used, but an empty string should be passed to allow for future expansion.

A new empty database is created, so when creating a Database object this creates an empty read-only database - sometimes useful to avoid special casing this situation, but otherwise of limited use. It's more useful when creating a WritableDatabase object, though beware that the current inmemory backend implementation was not built for performance and scalability.

This provides an equivalent to Xapian::InMemory::open() in Xapian 1.2.

Definition at line 182 of file constants.h.

Referenced by Xapian::Database::Database(), DEFINE_TESTCASE(), BackendManagerInMemory::do_get_database(), BackendManagerInMemory::get_writable_database(), open_stub(), and Xapian::WritableDatabase::WritableDatabase().

◆ DB_BACKEND_STUB

const int Xapian::DB_BACKEND_STUB = 0x300

Open a stub database file.

When opening a Database, this flag means to only open it if it's a stub database file. There's rarely a good reason to do this - it's mostly provided as equivalent functionality to Xapian::Auto::open_stub() in Xapian 1.2.

Definition at line 166 of file constants.h.

Referenced by Xapian::Database::Database(), DEFINE_TESTCASE(), Xapian::DatabaseReplica::Internal::Internal(), and Xapian::WritableDatabase::WritableDatabase().

◆ DB_CREATE

const int Xapian::DB_CREATE = 0x02

Create a new database.

If the database already exists, an exception will be thrown.

Definition at line 43 of file constants.h.

Referenced by DEFINE_TESTCASE(), BackendManagerGlass::do_get_database_path(), BackendManagerGlass::get_writable_database(), GlassDatabase::GlassDatabase(), Xapian::DatabaseReplica::Internal::Internal(), and main().

◆ DB_CREATE_OR_OPEN

const int Xapian::DB_CREATE_OR_OPEN = 0x00

Create database if it doesn't already exist.

If no opening mode is specified, this is the default.

Definition at line 34 of file constants.h.

Referenced by DEFINE_TESTCASE(), and main().

◆ DB_CREATE_OR_OVERWRITE

const int Xapian::DB_CREATE_OR_OVERWRITE = 0x01

Create database if it doesn't already exist, or overwrite if it does.

Definition at line 37 of file constants.h.

Referenced by BackendManagerMulti::createdb_multi(), DEFINE_TESTCASE(), BackendManagerHoney::do_get_database_path(), and GlassDatabase::GlassDatabase().

◆ DB_DANGEROUS

const int Xapian::DB_DANGEROUS = 0x10

Update the database in-place.

Xapian's disk-based backends use block-based storage, with copy-on-write to allow the previous revision to be searched while a new revision forms.

This option means changed blocks get written back over the top of the old version. The benefits of this are that less I/O is required during indexing, and the result of indexing is more compact. The downsides are that you can't concurrently search while indexing, transactions can't be cancelled, and if indexing ends uncleanly (i.e. without commit() or WritableDatabase's destructor being called) then the database won't be usable.

Currently all the base files will be removed upon the first modification, and new base files will be written upon commit. This prevents new readers from opening the database while it unsafe to do so, but there's not currently a mechanism in Xapian to handle notifying existing readers.

Definition at line 102 of file constants.h.

Referenced by GlassTable::alter(), GlassTable::cancel(), GlassDatabase::compact(), HoneyDatabase::compact(), GlassCompact::multimerge_postlists(), HoneyCompact::multimerge_postlists(), GlassChanges::start(), GlassVersion::write(), HoneyVersion::write(), and GlassTable::write_block().

◆ DB_FULL_SYNC

const int Xapian::DB_FULL_SYNC = 0x08

Try to ensure changes are really written to disk.

Generally fsync() and similar functions only ensure that data has been sent to the drive. Modern drives have large write-back caches for performance, and a power failure could still lose data which is in the write-back cache waiting to be written.

Some platforms provide a way to ensure data has actually been written and setting DB_FULL_SYNC will attempt to do so where possible. The downside is that committing changes takes longer, and other I/O to the same disk may be delayed too.

Currently only macOS is supported, and only on some filing system types

  • if not supported, Xapian will use fsync() or similar instead.

Definition at line 82 of file constants.h.

Referenced by GlassVersion::sync(), and HoneyVersion::sync().

◆ DB_NO_SYNC

const int Xapian::DB_NO_SYNC = 0x04

Don't attempt to ensure changes have hit disk.

By default, Xapian ask the OS to ensure changes have hit disk (by calling fdatasync(), fsync() or similar functions). If these calls do their job, this should mean that when WritableDatabase::commit() returns, the changes are durable, but this comes at a performance cost, and if you don't mind losing changes in the case of a crash, power failure, etc, then this option can speed up indexing significantly.

Definition at line 65 of file constants.h.

Referenced by GlassChanges::commit(), GlassCompact::multimerge_postlists(), HoneyCompact::multimerge_postlists(), GlassTable::sync(), GlassVersion::sync(), and HoneyVersion::sync().

◆ DB_NO_TERMLIST

const int Xapian::DB_NO_TERMLIST = 0x20

When creating a database, don't create a termlist table.

For backends which support it (currently glass), this will prevent creation of a termlist table. This saves on the disk space that would be needed to store it, and the CPU and I/O needed to update it, but some features either inherently need the termlist table, or the current implementation of them requires it.

The following probably can't be sensibly implemented without it:

And the following currently require it:

  • Enquire::matching_terms_begin() - we could record this information during the match, though it might be hard to do without a speed penalty.
  • WritableDatabase::delete_document() - we could allow this with inexact statistics (like how Lucene does).
  • WritableDatabase::replace_document() if the document exists already (again, possible with inexact statistics).
  • Currently the list of which values are used in each document is stored in the termlist table, so things like iterating the values in a document require it (which is probably reasonable since iterating the terms in a document requires it).

You can also convert an existing database to not have a termlist table by simply deleting termlist.*.

Definition at line 135 of file constants.h.

Referenced by DEFINE_TESTCASE().

◆ DB_OPEN

const int Xapian::DB_OPEN = 0x03

◆ DB_RETRY_LOCK

const int Xapian::DB_RETRY_LOCK = 0x40

If the database is already locked, retry the lock.

By default, if the database is already locked by a writer, trying to open it again for writing will fail by throwing Xapian::DatabaseLockError. If this flag is specified, then Xapian will instead wait for the lock (indefinitely, unless it gets an error trying to do so).

Definition at line 144 of file constants.h.

Referenced by DEFINE_TESTCASE(), and GlassDatabase::get_database_write_lock().

◆ DBCHECK_FIX

const int Xapian::DBCHECK_FIX = 16

Fix problems.

For use with Xapian::Database::check().

No fixes are currently implemented for glass or honey.

Definition at line 238 of file constants.h.

Referenced by Xapian::Database::check_(), and main().

◆ DBCHECK_FULL_TREE

const int Xapian::DBCHECK_FULL_TREE = 2

Show a full display of the B-tree contents.

For use with Xapian::Database::check().

Definition at line 218 of file constants.h.

Referenced by GlassTableCheck::block_check(), and main().

◆ DBCHECK_SHORT_TREE

const int Xapian::DBCHECK_SHORT_TREE = 1

Show a short-format display of the B-tree contents.

For use with Xapian::Database::check().

Definition at line 212 of file constants.h.

Referenced by GlassTableCheck::block_check(), and main().

◆ DBCHECK_SHOW_FREELIST

const int Xapian::DBCHECK_SHOW_FREELIST = 4

Show the bitmap for the B-tree.

For use with Xapian::Database::check().

Definition at line 224 of file constants.h.

Referenced by GlassTableCheck::check(), and main().

◆ DBCHECK_SHOW_STATS

const int Xapian::DBCHECK_SHOW_STATS = 8

Show statistics for the B-tree.

For use with Xapian::Database::check().

Definition at line 230 of file constants.h.

Referenced by GlassTableCheck::check(), DEFINE_TESTCASE(), and main().

◆ DBCOMPACT_MULTIPASS

const int Xapian::DBCOMPACT_MULTIPASS = 8

If merging more than 3 databases, merge the postlists in multiple passes.

This is generally faster but requires more disk space for temporary files.

Definition at line 257 of file constants.h.

Referenced by GlassDatabase::compact(), HoneyDatabase::compact(), DEFINE_TESTCASE(), and main().

◆ DBCOMPACT_NO_RENUMBER

const int Xapian::DBCOMPACT_NO_RENUMBER = 4

Use the same document ids in the output as in the input(s).

By default compaction renumbers the document ids in the output database, currently by applying the same offset to all the document ids in a particular source database. If this flag is specified, then this renumbering doesn't happen, but all the document ids must be unique over all source databases. Currently the ranges of document ids in each source must not overlap either, though this restriction may be removed in the future.

Definition at line 251 of file constants.h.

Referenced by Xapian::Database::compact_(), DEFINE_TESTCASE(), BackendManagerHoney::do_get_database_path(), BackendManagerSingleFile::do_get_database_path(), BackendManagerHoney::finalise_generated_database(), BackendManagerSingleFile::finalise_generated_database(), and main().

◆ DBCOMPACT_SINGLE_FILE

const int Xapian::DBCOMPACT_SINGLE_FILE = 16

◆ DOC_ASSUME_VALID

const int Xapian::DOC_ASSUME_VALID = 1

Assume document id is valid.

By default, Database::get_document() checks that the document id passed is actually in use and throws DocNotFoundError if not. This flag can be used to disable this check - useful to save a bit of work when you know for sure that the document id is valid.

Some database backends may check anyway - the remote backend currently does.

Definition at line 275 of file constants.h.

Referenced by DEFINE_TESTCASE(), Xapian::Enquire::Internal::get_document(), and Xapian::Database::get_document().

◆ KEYSPEC_DEFVALUE

constexpr unsigned char Xapian::KEYSPEC_DEFVALUE = 2
staticconstexpr

◆ KEYSPEC_REVERSE

constexpr unsigned char Xapian::KEYSPEC_REVERSE = 1
staticconstexpr

◆ max_month_length

const char Xapian::max_month_length[12]
static
Initial value:
= {
31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
}

Definition at line 75 of file valuerangeproc.cc.

Referenced by vet_dm().

◆ UNICODE_IGNORE

const unsigned Xapian::UNICODE_IGNORE = numeric_limits<unsigned>::max()
static

Value representing "ignore this" when returned by check_infix() or check_infix_digit().

Definition at line 79 of file termgenerator_internal.cc.