compactor.h | compactor.h | |||
---|---|---|---|---|
/** @file compactor.h | /** @file compactor.h | |||
* @brief Compact a database, or merge and compact several. | * @brief Compact a database, or merge and compact several. | |||
*/ | */ | |||
/* Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010 Olly Betts | /* Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2010,2011 Olly Betts | |||
* Copyright (C) 2008 Lemur Consulting Ltd | * Copyright (C) 2008 Lemur Consulting Ltd | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
skipping to change at line 52 | skipping to change at line 52 | |||
/// @internal Reference counted internals. | /// @internal Reference counted internals. | |||
Xapian::Internal::RefCntPtr<Internal> internal; | Xapian::Internal::RefCntPtr<Internal> internal; | |||
public: | public: | |||
Compactor(); | Compactor(); | |||
virtual ~Compactor(); | virtual ~Compactor(); | |||
/** Set the block size to use for tables in the output database. | /** Set the block size to use for tables in the output database. | |||
* | * | |||
* Valid block sizes are currently powers of two between 2048 and | * @param block_size The block size to use. Valid block sizes ar | |||
* 65536, with the default being 8192, but the valid sizes and | e | |||
* default may change in the future. | * currently powers of two between 2048 and 655 | |||
36, | ||||
* with the default being 8192, but the valid | ||||
* sizes and default may change in the future. | ||||
*/ | */ | |||
void set_block_size(size_t block_size); | void set_block_size(size_t block_size); | |||
/** Set whether to preserve existing document id values. | /** Set whether to preserve existing document id values. | |||
* | * | |||
* The default is true, which means that document ids will be renumber | * @param renumber The default is true, which means that docume | |||
ed - | nt ids will | |||
* currently by applying the same offset to all the document ids in a | * be renumbered - currently by applying the same offse | |||
* particular source database. | t | |||
* to all the document ids in a particular source | ||||
* database. | ||||
* | * | |||
* If false, then the document ids must be unique over all source | * If false, then the document ids must be unique over | |||
* databases. Currently the ranges of document ids in each source mus | all | |||
t | * source databases. Currently the ranges of document | |||
* not overlap either, though this restriction may be removed in the | ids | |||
* future. | * in each source must not overlap either, though this | |||
* restriction may be removed in the future. | ||||
*/ | */ | |||
void set_renumber(bool renumber); | void set_renumber(bool renumber); | |||
/** Set whether to merge postlists in multiple passes. | /** Set whether to merge postlists in multiple passes. | |||
* | * | |||
* Default is false. If set to true and merging more than 3 databases , | * @param multipass If true and merging more than 3 databases, | |||
* merge the postlists in multiple passes, which is generally faster b ut | * merge the postlists in multiple passes, which is generally faster b ut | |||
* requires more disk space for temporary files. | * requires more disk space for temporary files. By default we don't | |||
do | ||||
* this. | ||||
*/ | */ | |||
void set_multipass(bool multipass); | void set_multipass(bool multipass); | |||
/** Set the compaction level. | /** Set the compaction level. | |||
* | * | |||
* Values are: | * @param compaction Available values are: - Xapian::Compactor::STANDA | |||
* - Xapian::Compactor::STANDARD - Don't split items unnecessarily. | RD - | |||
* - Xapian::Compactor::FULL - Split items whenever it saves space | * Don't split items unnecessarily. - Xapian::Compactor::FULL - S | |||
* (the default). | plit | |||
* - Xapian::Compactor::FULLER - Allow oversize items to save more | * items whenever it saves space (the default). - | |||
* space. | * Xapian::Compactor::FULLER - Allow oversize items to save more spa | |||
* | ce | |||
* FULLER isn't recommended if you ever plan to update the compacted | * (not recommended if you ever plan to update the compacted database) | |||
* database. | . | |||
*/ | */ | |||
void set_compaction_level(compaction_level compaction); | void set_compaction_level(compaction_level compaction); | |||
/** Set where to write the output. | /** Set where to write the output. | |||
* | * | |||
* This can be the same as an input if that input is a stub database ( | * @param destdir Output path. This can be the same as an input if th | |||
in | at | |||
* which case it will be updated atomically). | * input is a stub database (in which case the database | |||
(s) | ||||
* listed in the stub will be compacted to a new databa | ||||
se | ||||
* and then the stub will be atomically updated to poin | ||||
t | ||||
* to this new database). | ||||
*/ | */ | |||
void set_destdir(const std::string & destdir); | void set_destdir(const std::string & destdir); | |||
/** Add a source database. */ | /** Add a source database. | |||
* | ||||
* @param srcdir The path to the source database to add. | ||||
*/ | ||||
void add_source(const std::string & srcdir); | void add_source(const std::string & srcdir); | |||
/// Perform the actual compaction/merging operation. | /// Perform the actual compaction/merging operation. | |||
void compact(); | void compact(); | |||
/** Update progress. | /** Update progress. | |||
* | * | |||
* Subclass this method if you want to get progress updates during | * Subclass this method if you want to get progress updates during | |||
* compaction. This is called for each table first with empty status, | * compaction. This is called for each table first with empty status, | |||
* And then one or more times with non-empty status. | * And then one or more times with non-empty status. | |||
* | * | |||
* The default implementation does nothing. | * The default implementation does nothing. | |||
* | ||||
* @param table The table currently being compacted. | ||||
* @param status A status message. | ||||
*/ | */ | |||
virtual void | virtual void | |||
set_status(const std::string & table, const std::string & status); | set_status(const std::string & table, const std::string & status); | |||
/** Resolve multiple user metadata entries with the same key. | /** Resolve multiple user metadata entries with the same key. | |||
* | * | |||
* When merging, if the same user metadata key is set in more than one | * When merging, if the same user metadata key is set in more than one | |||
* input, then this method is called to allow this to be resolving in | * input, then this method is called to allow this to be resolving in | |||
* an appropriate way. | * an appropriate way. | |||
* | * | |||
* The default implementation just returns tags[0]. | * The default implementation just returns tags[0]. | |||
* | * | |||
* For multipass this will currently get called multiple times for the | * For multipass this will currently get called multiple times for the | |||
* same key if there are duplicates to resolve in each pass, but this | * same key if there are duplicates to resolve in each pass, but this | |||
* may change in the future. | * may change in the future. | |||
* | ||||
* @param key The metadata key with duplicate entries. | ||||
* @param num_tags How many tags there are. | ||||
* @param tags An array of num_tags strings containing the tags to | ||||
* merge. | ||||
*/ | */ | |||
virtual std::string | virtual std::string | |||
resolve_duplicate_metadata(const std::string & key, | resolve_duplicate_metadata(const std::string & key, | |||
size_t num_tags, const std::string tags[]); | size_t num_tags, const std::string tags[]); | |||
}; | }; | |||
} | } | |||
#endif /* XAPIAN_INCLUDED_COMPACTOR_H */ | #endif /* XAPIAN_INCLUDED_COMPACTOR_H */ | |||
End of changes. 11 change blocks. | ||||
28 lines changed or deleted | 53 lines changed or added | |||
database.h | database.h | |||
---|---|---|---|---|
skipping to change at line 110 | skipping to change at line 110 | |||
/** Destroy this handle on the database. | /** Destroy this handle on the database. | |||
* | * | |||
* If there are no copies of this object remaining, the database(s) | * If there are no copies of this object remaining, the database(s) | |||
* will be closed. | * will be closed. | |||
*/ | */ | |||
virtual ~Database(); | virtual ~Database(); | |||
/** Copying is allowed. The internals are reference counted, so | /** Copying is allowed. The internals are reference counted, so | |||
* copying is cheap. | * copying is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
Database(const Database &other); | Database(const Database &other); | |||
/** Assignment is allowed. The internals are reference counted, | /** Assignment is allowed. The internals are reference counted, | |||
* so assignment is cheap. | * so assignment is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
void operator=(const Database &other); | void operator=(const Database &other); | |||
/** Re-open the database. | /** Re-open the database. | |||
* | * | |||
* This re-opens the database(s) to the latest available version(s) . | * This re-opens the database(s) to the latest available version(s) . | |||
* It can be used either to make sure the latest results are return ed, | * It can be used either to make sure the latest results are return ed, | |||
* or to recover from a Xapian::DatabaseModifiedError. | * or to recover from a Xapian::DatabaseModifiedError. | |||
* | * | |||
* Calling reopen() on a database which has been closed (with @a | * Calling reopen() on a database which has been closed (with @a | |||
skipping to change at line 166 | skipping to change at line 170 | |||
* to just behave correctly. | * to just behave correctly. | |||
*/ | */ | |||
virtual void close(); | virtual void close(); | |||
/// Return a string describing this object. | /// Return a string describing this object. | |||
virtual std::string get_description() const; | virtual std::string get_description() const; | |||
/** An iterator pointing to the start of the postlist | /** An iterator pointing to the start of the postlist | |||
* for a given term. | * for a given term. | |||
* | * | |||
* If the term name is the empty string, the iterator returned | * @param tname The termname to iterate postings for. If th | |||
* will list all the documents in the database. Such an iterator | e | |||
* will always return a WDF value of 1, since there is no obvious | * term name is the empty string, the iterator | |||
* meaning for this quantity in this case. | * returned will list all the documents in the | |||
* database. Such an iterator will always retu | ||||
rn | ||||
* a WDF value of 1, since there is no obvious | ||||
* meaning for this quantity in this case. | ||||
*/ | */ | |||
PostingIterator postlist_begin(const std::string &tname) const; | PostingIterator postlist_begin(const std::string &tname) const; | |||
/** Corresponding end iterator to postlist_begin(). | /** Corresponding end iterator to postlist_begin(). | |||
*/ | */ | |||
PostingIterator postlist_end(const std::string &) const { | PostingIterator postlist_end(const std::string &) const { | |||
return PostingIterator(); | return PostingIterator(); | |||
} | } | |||
/** An iterator pointing to the start of the termlist | /** An iterator pointing to the start of the termlist | |||
* for a given document. | * for a given document. | |||
* | ||||
* @param did The document id of the document to iterate terms for | ||||
. | ||||
*/ | */ | |||
TermIterator termlist_begin(Xapian::docid did) const; | TermIterator termlist_begin(Xapian::docid did) const; | |||
/** Corresponding end iterator to termlist_begin(). | /** Corresponding end iterator to termlist_begin(). | |||
*/ | */ | |||
TermIterator termlist_end(Xapian::docid) const { | TermIterator termlist_end(Xapian::docid) const { | |||
return TermIterator(); | return TermIterator(); | |||
} | } | |||
/** Does this database have any positional information? */ | /** Does this database have any positional information? */ | |||
skipping to change at line 247 | skipping to change at line 255 | |||
Xapian::docid get_lastdocid() const; | Xapian::docid get_lastdocid() const; | |||
/// Get the average length of the documents in the database. | /// Get the average length of the documents in the database. | |||
Xapian::doclength get_avlength() const; | Xapian::doclength get_avlength() const; | |||
/// Get the number of documents in the database indexed by a given t erm. | /// Get the number of documents in the database indexed by a given t erm. | |||
Xapian::doccount get_termfreq(const std::string & tname) const; | Xapian::doccount get_termfreq(const std::string & tname) const; | |||
/** Check if a given term exists in the database. | /** Check if a given term exists in the database. | |||
* | * | |||
* Return true if and only if the term exists in the database. | * @param tname The term to test the existence of. | |||
* This is the same as (get_termfreq(tname) != 0), but will often b | * | |||
e | * @return true if and only if the term exists in the database. | |||
* more efficient. | * This is the same as (get_termfreq(tname) != 0), but | |||
* will often be more efficient. | ||||
*/ | */ | |||
bool term_exists(const std::string & tname) const; | bool term_exists(const std::string & tname) const; | |||
/** Return the total number of occurrences of the given term. | /** Return the total number of occurrences of the given term. | |||
* | * | |||
* This is the sum of the number of occurrences of the term in each | * This is the sum of the number of occurrences of the term in each | |||
* document it indexes: i.e., the sum of the within document | * document it indexes: i.e., the sum of the within document | |||
* frequencies of the term. | * frequencies of the term. | |||
* | * | |||
* @param tname The term whose collection frequency is being | * @param tname The term whose collection frequency is being | |||
skipping to change at line 508 | skipping to change at line 518 | |||
* couldn't be acquired on the database. | * couldn't be acquired on the database. | |||
*/ | */ | |||
WritableDatabase(const std::string &path, int action); | WritableDatabase(const std::string &path, int action); | |||
/** @private @internal Create an WritableDatabase given its internal s. | /** @private @internal Create an WritableDatabase given its internal s. | |||
*/ | */ | |||
explicit WritableDatabase(Database::Internal *internal); | explicit WritableDatabase(Database::Internal *internal); | |||
/** Copying is allowed. The internals are reference counted, so | /** Copying is allowed. The internals are reference counted, so | |||
* copying is cheap. | * copying is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
WritableDatabase(const WritableDatabase &other); | WritableDatabase(const WritableDatabase &other); | |||
/** Assignment is allowed. The internals are reference counted, | /** Assignment is allowed. The internals are reference counted, | |||
* so assignment is cheap. | * so assignment is cheap. | |||
* | * | |||
* Note that only an WritableDatabase may be assigned to an | * Note that only an WritableDatabase may be assigned to an | |||
* WritableDatabase: an attempt to assign a Database is caught | * WritableDatabase: an attempt to assign a Database is caught | |||
* at compile-time. | * at compile-time. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
void operator=(const WritableDatabase &other); | void operator=(const WritableDatabase &other); | |||
/** Commit any pending modifications made to the database. | /** Commit any pending modifications made to the database. | |||
* | * | |||
* For efficiency reasons, when performing multiple updates to a | * For efficiency reasons, when performing multiple updates to a | |||
* database it is best (indeed, almost essential) to make as many | * database it is best (indeed, almost essential) to make as many | |||
* modifications as memory will permit in a single pass through | * modifications as memory will permit in a single pass through | |||
* the database. To ensure this, Xapian batches up modifications. | * the database. To ensure this, Xapian batches up modifications. | |||
* | * | |||
skipping to change at line 549 | skipping to change at line 563 | |||
* take much longer. | * take much longer. | |||
* | * | |||
* Note that commit() need not be called explicitly: it will be cal led | * Note that commit() need not be called explicitly: it will be cal led | |||
* automatically when the database is closed, or when a sufficient | * automatically when the database is closed, or when a sufficient | |||
* number of modifications have been made. By default, this is eve ry | * number of modifications have been made. By default, this is eve ry | |||
* 10000 documents added, deleted, or modified. This value is rath er | * 10000 documents added, deleted, or modified. This value is rath er | |||
* conservative, and if you have a machine with plenty of memory, | * conservative, and if you have a machine with plenty of memory, | |||
* you can improve indexing throughput dramatically by setting | * you can improve indexing throughput dramatically by setting | |||
* XAPIAN_FLUSH_THRESHOLD in the environment to a larger value. | * XAPIAN_FLUSH_THRESHOLD in the environment to a larger value. | |||
* | * | |||
* This method was new in Xapian 1.1.0 - in earlier versions it was | ||||
* called flush(). | ||||
* | ||||
* @exception Xapian::DatabaseError will be thrown if a problem occ urs | * @exception Xapian::DatabaseError will be thrown if a problem occ urs | |||
* while modifying the database. | * while modifying the database. | |||
* | * | |||
* @exception Xapian::DatabaseCorruptError will be thrown if the | * @exception Xapian::DatabaseCorruptError will be thrown if the | |||
* database is in a corrupt state. | * database is in a corrupt state. | |||
*/ | */ | |||
void commit(); | void commit(); | |||
/** Pre-1.1.0 name for commit(). | /** Pre-1.1.0 name for commit(). | |||
* | * | |||
skipping to change at line 595 | skipping to change at line 612 | |||
* ensure that each group is either applied or not applied, then | * ensure that each group is either applied or not applied, then | |||
* you can prevent the automatic commit() before and after the | * you can prevent the automatic commit() before and after the | |||
* transaction by starting the transaction with | * transaction by starting the transaction with | |||
* begin_transaction(false). However, if cancel_transaction is | * begin_transaction(false). However, if cancel_transaction is | |||
* called (or if commit_transaction isn't called before the | * called (or if commit_transaction isn't called before the | |||
* WritableDatabase object is destroyed) then any changes which | * WritableDatabase object is destroyed) then any changes which | |||
* were pending before the transaction began will also be discarded . | * were pending before the transaction began will also be discarded . | |||
* | * | |||
* Transactions aren't currently supported by the InMemory backend. | * Transactions aren't currently supported by the InMemory backend. | |||
* | * | |||
* @param flushed Is this a flushed transaction? By default | ||||
* transactions are "flushed", which means that | ||||
* committing a transaction will ensure those | ||||
* changes are permanently written to the | ||||
* database. By contrast, unflushed transactio | ||||
ns | ||||
* only ensure that changes within the transact | ||||
ion | ||||
* are either all applied or all aren't. | ||||
* | ||||
* @exception Xapian::UnimplementedError will be thrown if transact ions | * @exception Xapian::UnimplementedError will be thrown if transact ions | |||
* are not available for this database type. | * are not available for this database type. | |||
* | * | |||
* @exception Xapian::InvalidOperationError will be thrown if this is | * @exception Xapian::InvalidOperationError will be thrown if this is | |||
* called at an invalid time, such as when a transaction | * called at an invalid time, such as when a transaction | |||
* is already in progress. | * is already in progress. | |||
*/ | */ | |||
void begin_transaction(bool flushed=true); | void begin_transaction(bool flushed=true); | |||
/** Complete the transaction currently in progress. | /** Complete the transaction currently in progress. | |||
skipping to change at line 772 | skipping to change at line 797 | |||
* with the specified document. If any documents are indexed by th e | * with the specified document. If any documents are indexed by th e | |||
* term, the lowest document ID will be used for the document, | * term, the lowest document ID will be used for the document, | |||
* otherwise a new document ID will be generated as for add_documen t. | * otherwise a new document ID will be generated as for add_documen t. | |||
* | * | |||
* One common use is to allow UIDs from another system to easily be | * One common use is to allow UIDs from another system to easily be | |||
* mapped to terms in Xapian. Note that this method doesn't | * mapped to terms in Xapian. Note that this method doesn't | |||
* automatically add unique_term as a term, so you'll need to call | * automatically add unique_term as a term, so you'll need to call | |||
* document.add_term(unique_term) first when using replace_document () | * document.add_term(unique_term) first when using replace_document () | |||
* in this way. | * in this way. | |||
* | * | |||
* Another possible use is to allow groups of documents to be marke | ||||
d for | ||||
* later deletion - for example, you could add a "deletion date" te | ||||
rm | ||||
* to documents at index time and use this method to easily and eff | ||||
iciently | ||||
* delete all documents due for deletion on a particular date. | ||||
* | ||||
* Note that changes to the database won't be immediately committed to | * Note that changes to the database won't be immediately committed to | |||
* disk; see commit() for more details. | * disk; see commit() for more details. | |||
* | * | |||
* As with all database modification operations, the effect is | * As with all database modification operations, the effect is | |||
* atomic: the document(s) will either be fully replaced, or the | * atomic: the document(s) will either be fully replaced, or the | |||
* document(s) fail to be replaced and an exception is thrown | * document(s) fail to be replaced and an exception is thrown | |||
* (possibly at a | * (possibly at a | |||
* later time when commit() is called or the database is closed). | * later time when commit() is called or the database is closed). | |||
* | * | |||
* @param unique_term The "unique" term. | * @param unique_term The "unique" term. | |||
skipping to change at line 823 | skipping to change at line 843 | |||
* then the word is removed completely. | * then the word is removed completely. | |||
* | * | |||
* @param word The word to remove. | * @param word The word to remove. | |||
* @param freqdec How much to decrease its frequency by (default 1 ). | * @param freqdec How much to decrease its frequency by (default 1 ). | |||
*/ | */ | |||
void remove_spelling(const std::string & word, | void remove_spelling(const std::string & word, | |||
Xapian::termcount freqdec = 1) const; | Xapian::termcount freqdec = 1) const; | |||
/** Add a synonym for a term. | /** Add a synonym for a term. | |||
* | * | |||
* If @a synonym is already a synonym for @a term, then no action i | * @param term The term to add a synonym for. | |||
s | * @param synonym The synonym to add. If this is already a | |||
* taken. | * synonym for @a term, then no action is taken | |||
. | ||||
*/ | */ | |||
void add_synonym(const std::string & term, | void add_synonym(const std::string & term, | |||
const std::string & synonym) const; | const std::string & synonym) const; | |||
/** Remove a synonym for a term. | /** Remove a synonym for a term. | |||
* | * | |||
* If @a synonym isn't a synonym for @a term, then no action is tak | * @param term The term to remove a synonym for. | |||
en. | * @param synonym The synonym to remove. If this isn't curren | |||
tly | ||||
* a synonym for @a term, then no action is tak | ||||
en. | ||||
*/ | */ | |||
void remove_synonym(const std::string & term, | void remove_synonym(const std::string & term, | |||
const std::string & synonym) const; | const std::string & synonym) const; | |||
/** Remove all synonyms for a term. | /** Remove all synonyms for a term. | |||
* | * | |||
* If @a term has no synonyms, no action is taken. | * @param term The term to remove all synonyms for. If the | |||
* term has no synonyms, no action is taken. | ||||
*/ | */ | |||
void clear_synonyms(const std::string & term) const; | void clear_synonyms(const std::string & term) const; | |||
/** Set the user-specified metadata associated with a given key. | /** Set the user-specified metadata associated with a given key. | |||
* | * | |||
* This method sets the metadata value associated with a given key. | * This method sets the metadata value associated with a given key. | |||
* If there is already a metadata value stored in the database with | * If there is already a metadata value stored in the database with | |||
* the same key, the old value is replaced. If you want to delete an | * the same key, the old value is replaced. If you want to delete an | |||
* existing item of metadata, just set its value to the empty strin g. | * existing item of metadata, just set its value to the empty strin g. | |||
* | * | |||
End of changes. 13 change blocks. | ||||
22 lines changed or deleted | 48 lines changed or added | |||
dbfactory.h | dbfactory.h | |||
---|---|---|---|---|
skipping to change at line 51 | skipping to change at line 51 | |||
* The stub database file contains serialised parameters for one | * The stub database file contains serialised parameters for one | |||
* or more databases. | * or more databases. | |||
* | * | |||
* @param file pathname of the stub database file. | * @param file pathname of the stub database file. | |||
*/ | */ | |||
XAPIAN_VISIBILITY_DEFAULT | XAPIAN_VISIBILITY_DEFAULT | |||
Database open_stub(const std::string &file); | Database open_stub(const std::string &file); | |||
/** Construct a WritableDatabase object for a stub database file. | /** Construct a WritableDatabase object for a stub database file. | |||
* | * | |||
* The stub database file must contain serialised parameters for exactly on | * The stub database file must contain serialised parameters for exactly o | |||
e | ne | |||
* database. | * database. | |||
* | * | |||
* @param file pathname of the stub database file. | * @param file pathname of the stub database file. | |||
* @param action determines handling of existing/non-existing databas | ||||
e: | ||||
* - Xapian::DB_CREATE fail if database already exi | ||||
st, | ||||
* otherwise create new database. | ||||
* - Xapian::DB_CREATE_OR_OPEN open existing database, or c | ||||
reate new | ||||
* database if none exists. | ||||
* - Xapian::DB_CREATE_OR_OVERWRITE overwrite existing database, or crea | ||||
te | ||||
* new database if none exists. | ||||
* - Xapian::DB_OPEN open existing database, failing if n | ||||
one | ||||
* exists. | ||||
*/ | */ | |||
XAPIAN_VISIBILITY_DEFAULT | XAPIAN_VISIBILITY_DEFAULT | |||
WritableDatabase open_stub(const std::string &file, int action); | WritableDatabase open_stub(const std::string &file, int action); | |||
} | } | |||
#ifdef XAPIAN_HAS_INMEMORY_BACKEND | #ifdef XAPIAN_HAS_INMEMORY_BACKEND | |||
/// Database factory functions for the inmemory backend. | /// Database factory functions for the inmemory backend. | |||
namespace InMemory { | namespace InMemory { | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 18 lines changed or added | |||
document.h | document.h | |||
---|---|---|---|---|
skipping to change at line 70 | skipping to change at line 70 | |||
Xapian::Internal::RefCntPtr<Internal> internal; | Xapian::Internal::RefCntPtr<Internal> internal; | |||
/** @private @internal Constructor is only used by internal classes. | /** @private @internal Constructor is only used by internal classes. | |||
* | * | |||
* @param internal_ pointer to internal opaque class | * @param internal_ pointer to internal opaque class | |||
*/ | */ | |||
explicit Document(Internal *internal_); | explicit Document(Internal *internal_); | |||
/** Copying is allowed. The internals are reference counted, so | /** Copying is allowed. The internals are reference counted, so | |||
* copying is cheap. | * copying is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
Document(const Document &other); | Document(const Document &other); | |||
/** Assignment is allowed. The internals are reference counted, | /** Assignment is allowed. The internals are reference counted, | |||
* so assignment is cheap. | * so assignment is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
void operator=(const Document &other); | void operator=(const Document &other); | |||
/// Make a new empty Document | /// Make a new empty Document | |||
Document(); | Document(); | |||
/// Destructor | /// Destructor | |||
~Document(); | ~Document(); | |||
/** Get value by number. | /** Get value by number. | |||
skipping to change at line 98 | skipping to change at line 102 | |||
* | * | |||
* @param slot The number of the value. | * @param slot The number of the value. | |||
*/ | */ | |||
std::string get_value(Xapian::valueno slot) const; | std::string get_value(Xapian::valueno slot) const; | |||
/** Add a new value. | /** Add a new value. | |||
* | * | |||
* The new value will replace any existing value with the same numb er | * The new value will replace any existing value with the same numb er | |||
* (or if the new value is empty, it will remove any existing value | * (or if the new value is empty, it will remove any existing value | |||
* with the same number). | * with the same number). | |||
* | ||||
* @param slot The value slot to add the value in. | ||||
* @param value The value to set. | ||||
*/ | */ | |||
void add_value(Xapian::valueno slot, const std::string &value); | void add_value(Xapian::valueno slot, const std::string &value); | |||
/// Remove any value with the given number. | /// Remove any value with the given number. | |||
void remove_value(Xapian::valueno slot); | void remove_value(Xapian::valueno slot); | |||
/// Remove all values associated with the document. | /// Remove all values associated with the document. | |||
void clear_values(); | void clear_values(); | |||
/** Get data stored in the document. | /** Get data stored in the document. | |||
* This is a potentially expensive operation, and shouldn't normall | * | |||
y | * This is potentially a relatively expensive operation, and should | |||
* be used in a match decider functor. Put data for use by match | n't | |||
* deciders in a value instead. | * normally be used during the match (e.g. in a PostingSource or ma | |||
tch | ||||
* decider functor. Put data for use by match deciders in a value | ||||
* instead. | ||||
*/ | */ | |||
std::string get_data() const; | std::string get_data() const; | |||
/// Set data stored in the document. | /** Set data stored in the document. | |||
* | ||||
* Xapian treats the data as an opaque blob. It may try to compres | ||||
s | ||||
* it, but other than that it will just store it and return it when | ||||
* requested. | ||||
* | ||||
* @param data The data to store. | ||||
*/ | ||||
void set_data(const std::string &data); | void set_data(const std::string &data); | |||
/** Add an occurrence of a term at a particular position. | /** Add an occurrence of a term at a particular position. | |||
* | * | |||
* Multiple occurrences of the term at the same position are | * Multiple occurrences of the term at the same position are | |||
* represented only once in the positional information, but do | * represented only once in the positional information, but do | |||
* increase the wdf. | * increase the wdf. | |||
* | * | |||
* If the term is not already in the document, it will be added to | * If the term is not already in the document, it will be added to | |||
* it. | * it. | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 23 lines changed or added | |||
enquire.h | enquire.h | |||
---|---|---|---|---|
skipping to change at line 101 | skipping to change at line 101 | |||
*/ | */ | |||
void fetch(const MSetIterator &item) const; | void fetch(const MSetIterator &item) const; | |||
/** Fetch all the items in the MSet. | /** Fetch all the items in the MSet. | |||
*/ | */ | |||
void fetch() const; | void fetch() const; | |||
/** This converts the weight supplied to a percentage score. | /** This converts the weight supplied to a percentage score. | |||
* The return value will be in the range 0 to 100, and will be 0 if | * The return value will be in the range 0 to 100, and will be 0 if | |||
* and only if the item did not match the query at all. | * and only if the item did not match the query at all. | |||
* | ||||
* @param wt The weight to convert. | ||||
*/ | */ | |||
Xapian::percent convert_to_percent(Xapian::weight wt) const; | Xapian::percent convert_to_percent(Xapian::weight wt) const; | |||
/// Return the percentage score for a particular item. | /// Return the percentage score for a particular item. | |||
Xapian::percent convert_to_percent(const MSetIterator &it) const; | Xapian::percent convert_to_percent(const MSetIterator &it) const; | |||
/** Return the term frequency of the given query term. | /** Return the term frequency of the given query term. | |||
* | * | |||
* @param tname The term to look for. | * @param tname The term to look for. | |||
* | * | |||
skipping to change at line 238 | skipping to change at line 240 | |||
MSetIterator back() const; | MSetIterator back() const; | |||
/** This returns the document at position i in this MSet object. | /** This returns the document at position i in this MSet object. | |||
* | * | |||
* Note that this is not the same as the document at rank i in the | * Note that this is not the same as the document at rank i in the | |||
* query, unless the "first" parameter to Xapian::Enquire::get_mset | * query, unless the "first" parameter to Xapian::Enquire::get_mset | |||
* was 0. Rather, it is the document at rank i + first. | * was 0. Rather, it is the document at rank i + first. | |||
* | * | |||
* In other words, the offset is into the documents represented by | * In other words, the offset is into the documents represented by | |||
* this object, not into the set of documents matching the query. | * this object, not into the set of documents matching the query. | |||
* | ||||
* @param i The index into the MSet. | ||||
*/ | */ | |||
MSetIterator operator[](Xapian::doccount i) const; | MSetIterator operator[](Xapian::doccount i) const; | |||
/// Allow use as an STL container | /// Allow use as an STL container | |||
//@{ | //@{ | |||
typedef MSetIterator value_type; // FIXME: not assignable... | typedef MSetIterator value_type; // FIXME: not assignable... | |||
typedef MSetIterator iterator; | typedef MSetIterator iterator; | |||
typedef MSetIterator const_iterator; | typedef MSetIterator const_iterator; | |||
typedef MSetIterator & reference; // Hmm | typedef MSetIterator & reference; // Hmm | |||
typedef MSetIterator & const_reference; | typedef MSetIterator & const_reference; | |||
skipping to change at line 465 | skipping to change at line 469 | |||
/** Iterator for the terms in this E-Set */ | /** Iterator for the terms in this E-Set */ | |||
ESetIterator begin() const; | ESetIterator begin() const; | |||
/** End iterator corresponding to begin() */ | /** End iterator corresponding to begin() */ | |||
ESetIterator end() const; | ESetIterator end() const; | |||
/** Iterator pointing to the last element of this E-Set */ | /** Iterator pointing to the last element of this E-Set */ | |||
ESetIterator back() const; | ESetIterator back() const; | |||
/** This returns the term at position i in this E-Set. */ | /** This returns the term at position i in this E-Set. | |||
* | ||||
* @param i The index into the ESet. | ||||
*/ | ||||
ESetIterator operator[](Xapian::termcount i) const; | ESetIterator operator[](Xapian::termcount i) const; | |||
/// Return a string describing this object. | /// Return a string describing this object. | |||
std::string get_description() const; | std::string get_description() const; | |||
}; | }; | |||
/** Iterate through terms in the ESet */ | /** Iterate through terms in the ESet */ | |||
class XAPIAN_VISIBILITY_DEFAULT ESetIterator { | class XAPIAN_VISIBILITY_DEFAULT ESetIterator { | |||
private: | private: | |||
friend class ESet; | friend class ESet; | |||
skipping to change at line 618 | skipping to change at line 625 | |||
/// Return a string describing this object. | /// Return a string describing this object. | |||
std::string get_description() const; | std::string get_description() const; | |||
}; | }; | |||
/** Base class for matcher decision functor. | /** Base class for matcher decision functor. | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT MatchDecider { | class XAPIAN_VISIBILITY_DEFAULT MatchDecider { | |||
public: | public: | |||
/** Decide whether we want this document to be in the MSet. | /** Decide whether we want this document to be in the MSet. | |||
* | * | |||
* Return true if the document is acceptable, or false if the docum | * @param doc The document to test. | |||
ent | * | |||
* @return true if the document is acceptable, or false if the docu | ||||
ment | ||||
* should be excluded from the MSet. | * should be excluded from the MSet. | |||
*/ | */ | |||
virtual bool operator()(const Xapian::Document &doc) const = 0; | virtual bool operator()(const Xapian::Document &doc) const = 0; | |||
/// Destructor. | /// Destructor. | |||
virtual ~MatchDecider(); | virtual ~MatchDecider(); | |||
}; | }; | |||
/** This class provides an interface to the information retrieval | /** This class provides an interface to the information retrieval | |||
* system for the purpose of searching. | * system for the purpose of searching. | |||
skipping to change at line 789 | skipping to change at line 798 | |||
* @param order This can be: | * @param order This can be: | |||
* - Xapian::Enquire::ASCENDING | * - Xapian::Enquire::ASCENDING | |||
* docids sort in ascending order (default) | * docids sort in ascending order (default) | |||
* - Xapian::Enquire::DESCENDING | * - Xapian::Enquire::DESCENDING | |||
* docids sort in descending order | * docids sort in descending order | |||
* - Xapian::Enquire::DONT_CARE | * - Xapian::Enquire::DONT_CARE | |||
* docids sort in whatever order is most efficient for the back end | * docids sort in whatever order is most efficient for the back end | |||
* | * | |||
* Note: If you add documents in strict date order, then a boolean | * Note: If you add documents in strict date order, then a boolean | |||
* search - i.e. set_weighting_scheme(Xapian::BoolWeight()) - with | * search - i.e. set_weighting_scheme(Xapian::BoolWeight()) - with | |||
* set_docid_order(Xapian::Enquire::DESCENDING) is a very efficient | * set_docid_order(Xapian::Enquire::DESCENDING) is an efficient | |||
* way to perform "sort by date, newest first". | * way to perform "sort by date, newest first", and with | |||
* set_docid_order(Xapian::Enquire::ASCENDING) a very efficient way | ||||
* to perform "sort by date, oldest first". | ||||
*/ | */ | |||
void set_docid_order(docid_order order); | void set_docid_order(docid_order order); | |||
/** Set the percentage and/or weight cutoffs. | /** Set the percentage and/or weight cutoffs. | |||
* | * | |||
* @param percent_cutoff Minimum percentage score for returned | * @param percent_cutoff Minimum percentage score for returned | |||
* documents. If a document has a lower percentage score than t his, | * documents. If a document has a lower percentage score than t his, | |||
* it will not appear in the MSet. If your intention is to ret urn | * it will not appear in the MSet. If your intention is to ret urn | |||
* only matches which contain all the terms in the query, then | * only matches which contain all the terms in the query, then | |||
* it's more efficient to use Xapian::Query::OP_AND instead of | * it's more efficient to use Xapian::Query::OP_AND instead of | |||
skipping to change at line 1009 | skipping to change at line 1020 | |||
* terms may be returned from expand | * terms may be returned from expand | |||
* - Xapian::Enquire::USE_EXACT_TERMFREQ for mult i | * - Xapian::Enquire::USE_EXACT_TERMFREQ for mult i | |||
* dbs, calculate the exact termfreq; otherwise an | * dbs, calculate the exact termfreq; otherwise an | |||
* approximation is used which can greatly impr ove | * approximation is used which can greatly impr ove | |||
* efficiency, but still returns good results. | * efficiency, but still returns good results. | |||
* @param k the parameter k in the query expansion algorith m | * @param k the parameter k in the query expansion algorith m | |||
* (default is 1.0) | * (default is 1.0) | |||
* @param edecider a decision functor to use to decide whether a | * @param edecider a decision functor to use to decide whether a | |||
* given term should be put in the ESet | * given term should be put in the ESet | |||
* | * | |||
* @param min_wt the minimum weight for included terms | ||||
* | ||||
* @return An ESet object containing the results of the | * @return An ESet object containing the results of the | |||
* expand. | * expand. | |||
* | * | |||
* @exception Xapian::InvalidArgumentError See class documentation . | * @exception Xapian::InvalidArgumentError See class documentation . | |||
*/ | */ | |||
ESet get_eset(Xapian::termcount maxitems, | ESet get_eset(Xapian::termcount maxitems, | |||
const RSet & omrset, | const RSet & omrset, | |||
int flags = 0, | int flags = 0, | |||
double k = 1.0, | double k = 1.0, | |||
const Xapian::ExpandDecider * edecider = 0) const; | const Xapian::ExpandDecider * edecider = 0) const; | |||
End of changes. 6 change blocks. | ||||
7 lines changed or deleted | 16 lines changed or added | |||
error.h | error.h | |||
---|---|---|---|---|
/** @file error.h | /** @file error.h | |||
* @brief Hierarchy of classes which Xapian can throw as exceptions. | * @brief Hierarchy of classes which Xapian can throw as exceptions. | |||
*/ | */ | |||
/* Warning: This file is generated by /data/home/olly/tmp/xapian-svn-snapsh ot/tags/1.2.7/xapian/xapian-core/generate-exceptions - do not modify direct ly! */ | /* Warning: This file is generated by /data/home/olly/tmp/xapian-svn-snapsh ot/tags/1.2.8/xapian/xapian-core/generate-exceptions - do not modify direct ly! */ | |||
/* Copyright (C) 2003,2004,2006,2007,2009 Olly Betts | /* Copyright (C) 2003,2004,2006,2007,2009 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
skipping to change at line 185 | skipping to change at line 185 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT AssertionError : public LogicError { | class XAPIAN_VISIBILITY_DEFAULT AssertionError : public LogicError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
AssertionError(const std::string &msg_, const std::string &context_, co nst char * error_string_) | AssertionError(const std::string &msg_, const std::string &context_, co nst char * error_string_) | |||
: LogicError(msg_, context_, "AssertionError", error_string_) {} | : LogicError(msg_, context_, "AssertionError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit AssertionError(const std::string &msg_, const std::string &con text_ = std::string(), int errno_ = 0) | explicit AssertionError(const std::string &msg_, const std::string &con text_ = std::string(), int errno_ = 0) | |||
: LogicError(msg_, context_, "AssertionError", errno_) {} | : LogicError(msg_, context_, "AssertionError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
AssertionError(const std::string &msg_, int errno_) | AssertionError(const std::string &msg_, int errno_) | |||
: LogicError(msg_, std::string(), "AssertionError", errno_) {} | : LogicError(msg_, std::string(), "AssertionError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
AssertionError(const std::string &msg_, const std::string &context_, co nst char * type_, const char * error_string_) | AssertionError(const std::string &msg_, const std::string &context_, co nst char * type_, const char * error_string_) | |||
: LogicError(msg_, context_, type_, error_string_) {} | : LogicError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 216 | skipping to change at line 227 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT InvalidArgumentError : public LogicError { | class XAPIAN_VISIBILITY_DEFAULT InvalidArgumentError : public LogicError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
InvalidArgumentError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | InvalidArgumentError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | |||
: LogicError(msg_, context_, "InvalidArgumentError", error_string_) {} | : LogicError(msg_, context_, "InvalidArgumentError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit InvalidArgumentError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | explicit InvalidArgumentError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | |||
: LogicError(msg_, context_, "InvalidArgumentError", errno_) {} | : LogicError(msg_, context_, "InvalidArgumentError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
InvalidArgumentError(const std::string &msg_, int errno_) | InvalidArgumentError(const std::string &msg_, int errno_) | |||
: LogicError(msg_, std::string(), "InvalidArgumentError", errno_) {} | : LogicError(msg_, std::string(), "InvalidArgumentError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
InvalidArgumentError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | InvalidArgumentError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | |||
: LogicError(msg_, context_, type_, error_string_) {} | : LogicError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 247 | skipping to change at line 269 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT InvalidOperationError : public LogicError { | class XAPIAN_VISIBILITY_DEFAULT InvalidOperationError : public LogicError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
InvalidOperationError(const std::string &msg_, const std::string &conte xt_, const char * error_string_) | InvalidOperationError(const std::string &msg_, const std::string &conte xt_, const char * error_string_) | |||
: LogicError(msg_, context_, "InvalidOperationError", error_string_) {} | : LogicError(msg_, context_, "InvalidOperationError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit InvalidOperationError(const std::string &msg_, const std::stri ng &context_ = std::string(), int errno_ = 0) | explicit InvalidOperationError(const std::string &msg_, const std::stri ng &context_ = std::string(), int errno_ = 0) | |||
: LogicError(msg_, context_, "InvalidOperationError", errno_) {} | : LogicError(msg_, context_, "InvalidOperationError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
InvalidOperationError(const std::string &msg_, int errno_) | InvalidOperationError(const std::string &msg_, int errno_) | |||
: LogicError(msg_, std::string(), "InvalidOperationError", errno_) { } | : LogicError(msg_, std::string(), "InvalidOperationError", errno_) { } | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
InvalidOperationError(const std::string &msg_, const std::string &conte xt_, const char * type_, const char * error_string_) | InvalidOperationError(const std::string &msg_, const std::string &conte xt_, const char * type_, const char * error_string_) | |||
: LogicError(msg_, context_, type_, error_string_) {} | : LogicError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 277 | skipping to change at line 310 | |||
/** UnimplementedError indicates an attempt to use an unimplemented feature . */ | /** UnimplementedError indicates an attempt to use an unimplemented feature . */ | |||
class XAPIAN_VISIBILITY_DEFAULT UnimplementedError : public LogicError { | class XAPIAN_VISIBILITY_DEFAULT UnimplementedError : public LogicError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
UnimplementedError(const std::string &msg_, const std::string &context_ , const char * error_string_) | UnimplementedError(const std::string &msg_, const std::string &context_ , const char * error_string_) | |||
: LogicError(msg_, context_, "UnimplementedError", error_string_) {} | : LogicError(msg_, context_, "UnimplementedError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit UnimplementedError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | explicit UnimplementedError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | |||
: LogicError(msg_, context_, "UnimplementedError", errno_) {} | : LogicError(msg_, context_, "UnimplementedError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
UnimplementedError(const std::string &msg_, int errno_) | UnimplementedError(const std::string &msg_, int errno_) | |||
: LogicError(msg_, std::string(), "UnimplementedError", errno_) {} | : LogicError(msg_, std::string(), "UnimplementedError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
UnimplementedError(const std::string &msg_, const std::string &context_ , const char * type_, const char * error_string_) | UnimplementedError(const std::string &msg_, const std::string &context_ , const char * type_, const char * error_string_) | |||
: LogicError(msg_, context_, type_, error_string_) {} | : LogicError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 307 | skipping to change at line 351 | |||
/** DatabaseError indicates some sort of database related error. */ | /** DatabaseError indicates some sort of database related error. */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT DatabaseError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseError(const std::string &msg_, const std::string &context_, con st char * error_string_) | DatabaseError(const std::string &msg_, const std::string &context_, con st char * error_string_) | |||
: RuntimeError(msg_, context_, "DatabaseError", error_string_) {} | : RuntimeError(msg_, context_, "DatabaseError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseError(const std::string &msg_, const std::string &cont ext_ = std::string(), int errno_ = 0) | explicit DatabaseError(const std::string &msg_, const std::string &cont ext_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "DatabaseError", errno_) {} | : RuntimeError(msg_, context_, "DatabaseError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseError(const std::string &msg_, int errno_) | DatabaseError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "DatabaseError", errno_) {} | : RuntimeError(msg_, std::string(), "DatabaseError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseError(const std::string &msg_, const std::string &context_, con st char * type_, const char * error_string_) | DatabaseError(const std::string &msg_, const std::string &context_, con st char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 337 | skipping to change at line 392 | |||
/** DatabaseCorruptError indicates database corruption was detected. */ | /** DatabaseCorruptError indicates database corruption was detected. */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseCorruptError : public DatabaseError { | class XAPIAN_VISIBILITY_DEFAULT DatabaseCorruptError : public DatabaseError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseCorruptError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | DatabaseCorruptError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | |||
: DatabaseError(msg_, context_, "DatabaseCorruptError", error_string _) {} | : DatabaseError(msg_, context_, "DatabaseCorruptError", error_string _) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseCorruptError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | explicit DatabaseCorruptError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | |||
: DatabaseError(msg_, context_, "DatabaseCorruptError", errno_) {} | : DatabaseError(msg_, context_, "DatabaseCorruptError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseCorruptError(const std::string &msg_, int errno_) | DatabaseCorruptError(const std::string &msg_, int errno_) | |||
: DatabaseError(msg_, std::string(), "DatabaseCorruptError", errno_) {} | : DatabaseError(msg_, std::string(), "DatabaseCorruptError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseCorruptError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | DatabaseCorruptError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | |||
: DatabaseError(msg_, context_, type_, error_string_) {} | : DatabaseError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 367 | skipping to change at line 433 | |||
/** DatabaseCreateError indicates a failure to create a database. */ | /** DatabaseCreateError indicates a failure to create a database. */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseCreateError : public DatabaseError { | class XAPIAN_VISIBILITY_DEFAULT DatabaseCreateError : public DatabaseError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseCreateError(const std::string &msg_, const std::string &context _, const char * error_string_) | DatabaseCreateError(const std::string &msg_, const std::string &context _, const char * error_string_) | |||
: DatabaseError(msg_, context_, "DatabaseCreateError", error_string_ ) {} | : DatabaseError(msg_, context_, "DatabaseCreateError", error_string_ ) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseCreateError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | explicit DatabaseCreateError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | |||
: DatabaseError(msg_, context_, "DatabaseCreateError", errno_) {} | : DatabaseError(msg_, context_, "DatabaseCreateError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseCreateError(const std::string &msg_, int errno_) | DatabaseCreateError(const std::string &msg_, int errno_) | |||
: DatabaseError(msg_, std::string(), "DatabaseCreateError", errno_) {} | : DatabaseError(msg_, std::string(), "DatabaseCreateError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseCreateError(const std::string &msg_, const std::string &context _, const char * type_, const char * error_string_) | DatabaseCreateError(const std::string &msg_, const std::string &context _, const char * type_, const char * error_string_) | |||
: DatabaseError(msg_, context_, type_, error_string_) {} | : DatabaseError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 397 | skipping to change at line 474 | |||
/** DatabaseLockError indicates failure to lock a database. */ | /** DatabaseLockError indicates failure to lock a database. */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseLockError : public DatabaseError { | class XAPIAN_VISIBILITY_DEFAULT DatabaseLockError : public DatabaseError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseLockError(const std::string &msg_, const std::string &context_, const char * error_string_) | DatabaseLockError(const std::string &msg_, const std::string &context_, const char * error_string_) | |||
: DatabaseError(msg_, context_, "DatabaseLockError", error_string_) {} | : DatabaseError(msg_, context_, "DatabaseLockError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseLockError(const std::string &msg_, const std::string & context_ = std::string(), int errno_ = 0) | explicit DatabaseLockError(const std::string &msg_, const std::string & context_ = std::string(), int errno_ = 0) | |||
: DatabaseError(msg_, context_, "DatabaseLockError", errno_) {} | : DatabaseError(msg_, context_, "DatabaseLockError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseLockError(const std::string &msg_, int errno_) | DatabaseLockError(const std::string &msg_, int errno_) | |||
: DatabaseError(msg_, std::string(), "DatabaseLockError", errno_) {} | : DatabaseError(msg_, std::string(), "DatabaseLockError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseLockError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | DatabaseLockError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | |||
: DatabaseError(msg_, context_, type_, error_string_) {} | : DatabaseError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 432 | skipping to change at line 520 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseModifiedError : public DatabaseErro r { | class XAPIAN_VISIBILITY_DEFAULT DatabaseModifiedError : public DatabaseErro r { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseModifiedError(const std::string &msg_, const std::string &conte xt_, const char * error_string_) | DatabaseModifiedError(const std::string &msg_, const std::string &conte xt_, const char * error_string_) | |||
: DatabaseError(msg_, context_, "DatabaseModifiedError", error_strin g_) {} | : DatabaseError(msg_, context_, "DatabaseModifiedError", error_strin g_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseModifiedError(const std::string &msg_, const std::stri ng &context_ = std::string(), int errno_ = 0) | explicit DatabaseModifiedError(const std::string &msg_, const std::stri ng &context_ = std::string(), int errno_ = 0) | |||
: DatabaseError(msg_, context_, "DatabaseModifiedError", errno_) {} | : DatabaseError(msg_, context_, "DatabaseModifiedError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseModifiedError(const std::string &msg_, int errno_) | DatabaseModifiedError(const std::string &msg_, int errno_) | |||
: DatabaseError(msg_, std::string(), "DatabaseModifiedError", errno_ ) {} | : DatabaseError(msg_, std::string(), "DatabaseModifiedError", errno_ ) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseModifiedError(const std::string &msg_, const std::string &conte xt_, const char * type_, const char * error_string_) | DatabaseModifiedError(const std::string &msg_, const std::string &conte xt_, const char * type_, const char * error_string_) | |||
: DatabaseError(msg_, context_, type_, error_string_) {} | : DatabaseError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 462 | skipping to change at line 561 | |||
/** DatabaseOpeningError indicates failure to open a database. */ | /** DatabaseOpeningError indicates failure to open a database. */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseOpeningError : public DatabaseError { | class XAPIAN_VISIBILITY_DEFAULT DatabaseOpeningError : public DatabaseError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseOpeningError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | DatabaseOpeningError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | |||
: DatabaseError(msg_, context_, "DatabaseOpeningError", error_string _) {} | : DatabaseError(msg_, context_, "DatabaseOpeningError", error_string _) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseOpeningError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | explicit DatabaseOpeningError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | |||
: DatabaseError(msg_, context_, "DatabaseOpeningError", errno_) {} | : DatabaseError(msg_, context_, "DatabaseOpeningError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseOpeningError(const std::string &msg_, int errno_) | DatabaseOpeningError(const std::string &msg_, int errno_) | |||
: DatabaseError(msg_, std::string(), "DatabaseOpeningError", errno_) {} | : DatabaseError(msg_, std::string(), "DatabaseOpeningError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseOpeningError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | DatabaseOpeningError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | |||
: DatabaseError(msg_, context_, type_, error_string_) {} | : DatabaseError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 502 | skipping to change at line 612 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT DatabaseVersionError : public DatabaseOpeni ngError { | class XAPIAN_VISIBILITY_DEFAULT DatabaseVersionError : public DatabaseOpeni ngError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DatabaseVersionError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | DatabaseVersionError(const std::string &msg_, const std::string &contex t_, const char * error_string_) | |||
: DatabaseOpeningError(msg_, context_, "DatabaseVersionError", error _string_) {} | : DatabaseOpeningError(msg_, context_, "DatabaseVersionError", error _string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DatabaseVersionError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | explicit DatabaseVersionError(const std::string &msg_, const std::strin g &context_ = std::string(), int errno_ = 0) | |||
: DatabaseOpeningError(msg_, context_, "DatabaseVersionError", errno _) {} | : DatabaseOpeningError(msg_, context_, "DatabaseVersionError", errno _) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DatabaseVersionError(const std::string &msg_, int errno_) | DatabaseVersionError(const std::string &msg_, int errno_) | |||
: DatabaseOpeningError(msg_, std::string(), "DatabaseVersionError", errno_) {} | : DatabaseOpeningError(msg_, std::string(), "DatabaseVersionError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DatabaseVersionError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | DatabaseVersionError(const std::string &msg_, const std::string &contex t_, const char * type_, const char * error_string_) | |||
: DatabaseOpeningError(msg_, context_, type_, error_string_) {} | : DatabaseOpeningError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 532 | skipping to change at line 653 | |||
/** Indicates an attempt to access a document not present in the database. */ | /** Indicates an attempt to access a document not present in the database. */ | |||
class XAPIAN_VISIBILITY_DEFAULT DocNotFoundError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT DocNotFoundError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
DocNotFoundError(const std::string &msg_, const std::string &context_, const char * error_string_) | DocNotFoundError(const std::string &msg_, const std::string &context_, const char * error_string_) | |||
: RuntimeError(msg_, context_, "DocNotFoundError", error_string_) {} | : RuntimeError(msg_, context_, "DocNotFoundError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit DocNotFoundError(const std::string &msg_, const std::string &c ontext_ = std::string(), int errno_ = 0) | explicit DocNotFoundError(const std::string &msg_, const std::string &c ontext_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "DocNotFoundError", errno_) {} | : RuntimeError(msg_, context_, "DocNotFoundError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
DocNotFoundError(const std::string &msg_, int errno_) | DocNotFoundError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "DocNotFoundError", errno_) {} | : RuntimeError(msg_, std::string(), "DocNotFoundError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
DocNotFoundError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | DocNotFoundError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 566 | skipping to change at line 698 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT FeatureUnavailableError : public RuntimeErr or { | class XAPIAN_VISIBILITY_DEFAULT FeatureUnavailableError : public RuntimeErr or { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
FeatureUnavailableError(const std::string &msg_, const std::string &con text_, const char * error_string_) | FeatureUnavailableError(const std::string &msg_, const std::string &con text_, const char * error_string_) | |||
: RuntimeError(msg_, context_, "FeatureUnavailableError", error_stri ng_) {} | : RuntimeError(msg_, context_, "FeatureUnavailableError", error_stri ng_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit FeatureUnavailableError(const std::string &msg_, const std::st ring &context_ = std::string(), int errno_ = 0) | explicit FeatureUnavailableError(const std::string &msg_, const std::st ring &context_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "FeatureUnavailableError", errno_) {} | : RuntimeError(msg_, context_, "FeatureUnavailableError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
FeatureUnavailableError(const std::string &msg_, int errno_) | FeatureUnavailableError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "FeatureUnavailableError", errno _) {} | : RuntimeError(msg_, std::string(), "FeatureUnavailableError", errno _) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
FeatureUnavailableError(const std::string &msg_, const std::string &con text_, const char * type_, const char * error_string_) | FeatureUnavailableError(const std::string &msg_, const std::string &con text_, const char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 596 | skipping to change at line 739 | |||
/** InternalError indicates a runtime problem of some sort. */ | /** InternalError indicates a runtime problem of some sort. */ | |||
class XAPIAN_VISIBILITY_DEFAULT InternalError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT InternalError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
InternalError(const std::string &msg_, const std::string &context_, con st char * error_string_) | InternalError(const std::string &msg_, const std::string &context_, con st char * error_string_) | |||
: RuntimeError(msg_, context_, "InternalError", error_string_) {} | : RuntimeError(msg_, context_, "InternalError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit InternalError(const std::string &msg_, const std::string &cont ext_ = std::string(), int errno_ = 0) | explicit InternalError(const std::string &msg_, const std::string &cont ext_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "InternalError", errno_) {} | : RuntimeError(msg_, context_, "InternalError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
InternalError(const std::string &msg_, int errno_) | InternalError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "InternalError", errno_) {} | : RuntimeError(msg_, std::string(), "InternalError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
InternalError(const std::string &msg_, const std::string &context_, con st char * type_, const char * error_string_) | InternalError(const std::string &msg_, const std::string &context_, con st char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 626 | skipping to change at line 780 | |||
/** Indicates a problem communicating with a remote database. */ | /** Indicates a problem communicating with a remote database. */ | |||
class XAPIAN_VISIBILITY_DEFAULT NetworkError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT NetworkError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
NetworkError(const std::string &msg_, const std::string &context_, cons t char * error_string_) | NetworkError(const std::string &msg_, const std::string &context_, cons t char * error_string_) | |||
: RuntimeError(msg_, context_, "NetworkError", error_string_) {} | : RuntimeError(msg_, context_, "NetworkError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit NetworkError(const std::string &msg_, const std::string &conte xt_ = std::string(), int errno_ = 0) | explicit NetworkError(const std::string &msg_, const std::string &conte xt_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "NetworkError", errno_) {} | : RuntimeError(msg_, context_, "NetworkError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
NetworkError(const std::string &msg_, int errno_) | NetworkError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "NetworkError", errno_) {} | : RuntimeError(msg_, std::string(), "NetworkError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
NetworkError(const std::string &msg_, const std::string &context_, cons t char * type_, const char * error_string_) | NetworkError(const std::string &msg_, const std::string &context_, cons t char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 656 | skipping to change at line 821 | |||
/** Indicates a timeout expired while communicating with a remote database. */ | /** Indicates a timeout expired while communicating with a remote database. */ | |||
class XAPIAN_VISIBILITY_DEFAULT NetworkTimeoutError : public NetworkError { | class XAPIAN_VISIBILITY_DEFAULT NetworkTimeoutError : public NetworkError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
NetworkTimeoutError(const std::string &msg_, const std::string &context _, const char * error_string_) | NetworkTimeoutError(const std::string &msg_, const std::string &context _, const char * error_string_) | |||
: NetworkError(msg_, context_, "NetworkTimeoutError", error_string_) {} | : NetworkError(msg_, context_, "NetworkTimeoutError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit NetworkTimeoutError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | explicit NetworkTimeoutError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | |||
: NetworkError(msg_, context_, "NetworkTimeoutError", errno_) {} | : NetworkError(msg_, context_, "NetworkTimeoutError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
NetworkTimeoutError(const std::string &msg_, int errno_) | NetworkTimeoutError(const std::string &msg_, int errno_) | |||
: NetworkError(msg_, std::string(), "NetworkTimeoutError", errno_) { } | : NetworkError(msg_, std::string(), "NetworkTimeoutError", errno_) { } | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
NetworkTimeoutError(const std::string &msg_, const std::string &context _, const char * type_, const char * error_string_) | NetworkTimeoutError(const std::string &msg_, const std::string &context _, const char * type_, const char * error_string_) | |||
: NetworkError(msg_, context_, type_, error_string_) {} | : NetworkError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 686 | skipping to change at line 862 | |||
/** Indicates a query string can't be parsed. */ | /** Indicates a query string can't be parsed. */ | |||
class XAPIAN_VISIBILITY_DEFAULT QueryParserError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT QueryParserError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
QueryParserError(const std::string &msg_, const std::string &context_, const char * error_string_) | QueryParserError(const std::string &msg_, const std::string &context_, const char * error_string_) | |||
: RuntimeError(msg_, context_, "QueryParserError", error_string_) {} | : RuntimeError(msg_, context_, "QueryParserError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit QueryParserError(const std::string &msg_, const std::string &c ontext_ = std::string(), int errno_ = 0) | explicit QueryParserError(const std::string &msg_, const std::string &c ontext_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "QueryParserError", errno_) {} | : RuntimeError(msg_, context_, "QueryParserError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
QueryParserError(const std::string &msg_, int errno_) | QueryParserError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "QueryParserError", errno_) {} | : RuntimeError(msg_, std::string(), "QueryParserError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
QueryParserError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | QueryParserError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 716 | skipping to change at line 903 | |||
/** Indicates an error in the std::string serialisation of an object. */ | /** Indicates an error in the std::string serialisation of an object. */ | |||
class XAPIAN_VISIBILITY_DEFAULT SerialisationError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT SerialisationError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
SerialisationError(const std::string &msg_, const std::string &context_ , const char * error_string_) | SerialisationError(const std::string &msg_, const std::string &context_ , const char * error_string_) | |||
: RuntimeError(msg_, context_, "SerialisationError", error_string_) {} | : RuntimeError(msg_, context_, "SerialisationError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit SerialisationError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | explicit SerialisationError(const std::string &msg_, const std::string &context_ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "SerialisationError", errno_) {} | : RuntimeError(msg_, context_, "SerialisationError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
SerialisationError(const std::string &msg_, int errno_) | SerialisationError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "SerialisationError", errno_) {} | : RuntimeError(msg_, std::string(), "SerialisationError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
SerialisationError(const std::string &msg_, const std::string &context_ , const char * type_, const char * error_string_) | SerialisationError(const std::string &msg_, const std::string &context_ , const char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
skipping to change at line 747 | skipping to change at line 945 | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT RangeError : public RuntimeError { | class XAPIAN_VISIBILITY_DEFAULT RangeError : public RuntimeError { | |||
public: | public: | |||
/** @private @internal | /** @private @internal | |||
* @brief Private constructor for use by remote backend. | * @brief Private constructor for use by remote backend. | |||
* | * | |||
* @param error_string_ Optional string describing error. May be NU LL. | * @param error_string_ Optional string describing error. May be NU LL. | |||
*/ | */ | |||
RangeError(const std::string &msg_, const std::string &context_, const char * error_string_) | RangeError(const std::string &msg_, const std::string &context_, const char * error_string_) | |||
: RuntimeError(msg_, context_, "RangeError", error_string_) {} | : RuntimeError(msg_, context_, "RangeError", error_string_) {} | |||
/** General purpose constructor which allows setting errno. */ | /** General purpose constructor. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param context_ Optional context information for this error. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
explicit RangeError(const std::string &msg_, const std::string &context _ = std::string(), int errno_ = 0) | explicit RangeError(const std::string &msg_, const std::string &context _ = std::string(), int errno_ = 0) | |||
: RuntimeError(msg_, context_, "RangeError", errno_) {} | : RuntimeError(msg_, context_, "RangeError", errno_) {} | |||
/** Construct from message and errno value. */ | /** Construct from message and errno value. | |||
* | ||||
* @param msg_ Message giving details of the error, intende | ||||
d | ||||
* for human consumption. | ||||
* @param errno_ Optional errno value associated with this er | ||||
ror. | ||||
*/ | ||||
RangeError(const std::string &msg_, int errno_) | RangeError(const std::string &msg_, int errno_) | |||
: RuntimeError(msg_, std::string(), "RangeError", errno_) {} | : RuntimeError(msg_, std::string(), "RangeError", errno_) {} | |||
protected: | protected: | |||
/** @private @internal | /** @private @internal | |||
* @brief Constructor for use by constructors of derived classes. | * @brief Constructor for use by constructors of derived classes. | |||
*/ | */ | |||
RangeError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | RangeError(const std::string &msg_, const std::string &context_, const char * type_, const char * error_string_) | |||
: RuntimeError(msg_, context_, type_, error_string_) {} | : RuntimeError(msg_, context_, type_, error_string_) {} | |||
/** @private @internal | /** @private @internal | |||
End of changes. 39 change blocks. | ||||
39 lines changed or deleted | 324 lines changed or added | |||
expanddecider.h | expanddecider.h | |||
---|---|---|---|---|
/** @file expanddecider.h | /** @file expanddecider.h | |||
* @brief Allow rejection of terms during ESet generation. | * @brief Allow rejection of terms during ESet generation. | |||
*/ | */ | |||
/* Copyright (C) 2007 Olly Betts | /* Copyright (C) 2007,2011 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 34 | skipping to change at line 34 | |||
#include <set> | #include <set> | |||
#include <string> | #include <string> | |||
#include <xapian/visibility.h> | #include <xapian/visibility.h> | |||
namespace Xapian { | namespace Xapian { | |||
/** Virtual base class for expand decider functor. */ | /** Virtual base class for expand decider functor. */ | |||
class XAPIAN_VISIBILITY_DEFAULT ExpandDecider { | class XAPIAN_VISIBILITY_DEFAULT ExpandDecider { | |||
public: | public: | |||
/** Do we want this term in the ESet? */ | /** Do we want this term in the ESet? | |||
* | ||||
* @param term The term to test. | ||||
*/ | ||||
virtual bool operator()(const std::string &term) const = 0; | virtual bool operator()(const std::string &term) const = 0; | |||
/** Virtual destructor, because we have virtual methods. */ | /** Virtual destructor, because we have virtual methods. */ | |||
virtual ~ExpandDecider(); | virtual ~ExpandDecider(); | |||
}; | }; | |||
/** ExpandDecider subclass which rejects terms using two ExpandDeciders. | /** ExpandDecider subclass which rejects terms using two ExpandDeciders. | |||
* | * | |||
* Terms are only accepted if they are accepted by both of the specified | * Terms are only accepted if they are accepted by both of the specified | |||
* ExpandDecider objects. | * ExpandDecider objects. | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderAnd : public ExpandDecider { | class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderAnd : public ExpandDecider { | |||
const ExpandDecider &first, &second; | const ExpandDecider &first, &second; | |||
public: | public: | |||
/** Terms will be checked with @a first, and if accepted, then checked | /** Terms will be checked with @a first, and if accepted, then checked | |||
* with @a second. | * with @a second. | |||
* | ||||
* @param first_ First ExpandDecider object to test with. | ||||
* @param second_ ExpandDecider object to test with if first_ accepts. | ||||
*/ | */ | |||
ExpandDeciderAnd(const ExpandDecider &first_, | ExpandDeciderAnd(const ExpandDecider &first_, | |||
const ExpandDecider &second_) | const ExpandDecider &second_) | |||
: first(first_), second(second_) { } | : first(first_), second(second_) { } | |||
/** Compatibility method. */ | /** Compatibility method. | |||
* | ||||
* @param first_ First ExpandDecider object to test with. | ||||
* @param second_ ExpandDecider object to test with if first_ accepts. | ||||
*/ | ||||
ExpandDeciderAnd(const ExpandDecider *first_, | ExpandDeciderAnd(const ExpandDecider *first_, | |||
const ExpandDecider *second_) | const ExpandDecider *second_) | |||
: first(*first_), second(*second_) { } | : first(*first_), second(*second_) { } | |||
virtual bool operator()(const std::string &term) const; | virtual bool operator()(const std::string &term) const; | |||
}; | }; | |||
/** ExpandDecider subclass which rejects terms in a specified list. | /** ExpandDecider subclass which rejects terms in a specified list. | |||
* | * | |||
* ExpandDeciderFilterTerms provides an easy way to filter out terms from | * ExpandDeciderFilterTerms provides an easy way to filter out terms from | |||
* a fixed list when generating an ESet. | * a fixed list when generating an ESet. | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderFilterTerms : public ExpandDec ider { | class XAPIAN_VISIBILITY_DEFAULT ExpandDeciderFilterTerms : public ExpandDec ider { | |||
std::set<std::string> rejects; | std::set<std::string> rejects; | |||
public: | public: | |||
/** The two iterators specify a list of terms to be rejected. | /** The two iterators specify a list of terms to be rejected. | |||
* | * | |||
* @a reject_begin and @a reject_end can be any input_iterator type | * @param reject_begin Begin iterator for the list of terms to | |||
* which returns std::string or char * (e.g. TermIterator or char **). | * reject. It can be any input_iterator type | |||
* which returns std::string or char * (e.g. | ||||
* TermIterator or char **). | ||||
* @param reject_end End iterator for the list of terms to reject | ||||
. | ||||
*/ | */ | |||
template <class Iterator> | template <class Iterator> | |||
ExpandDeciderFilterTerms(Iterator reject_begin, Iterator reject_end) | ExpandDeciderFilterTerms(Iterator reject_begin, Iterator reject_end) | |||
: rejects(reject_begin, reject_end) { } | : rejects(reject_begin, reject_end) { } | |||
virtual bool operator()(const std::string &term) const; | virtual bool operator()(const std::string &term) const; | |||
}; | }; | |||
} | } | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 19 lines changed or added | |||
keymaker.h | keymaker.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
#include <xapian/types.h> | #include <xapian/types.h> | |||
#include <xapian/visibility.h> | #include <xapian/visibility.h> | |||
namespace Xapian { | namespace Xapian { | |||
class Document; | class Document; | |||
/** Virtual base class for key making functors. */ | /** Virtual base class for key making functors. */ | |||
class XAPIAN_VISIBILITY_DEFAULT KeyMaker { | class XAPIAN_VISIBILITY_DEFAULT KeyMaker { | |||
public: | public: | |||
/** This method takes a Document object and builds a key string from it . | /** Build a key string for a Document. | |||
* | * | |||
* These keys are then used for ordering or collapsing matching docume | * These keys can be used for sorting or collapsing matching documents | |||
nts. | . | |||
* | ||||
* @param doc Document object to build a key for. | ||||
*/ | */ | |||
virtual std::string operator()(const Xapian::Document & doc) const = 0; | virtual std::string operator()(const Xapian::Document & doc) const = 0; | |||
/** Virtual destructor, because we have virtual methods. */ | /** Virtual destructor, because we have virtual methods. */ | |||
virtual ~KeyMaker(); | virtual ~KeyMaker(); | |||
}; | }; | |||
/** KeyMaker subclass which combines several values. | /** KeyMaker subclass which combines several values. | |||
* | * | |||
* When the result is used for sorting, results are ordered by the first | * When the result is used for sorting, results are ordered by the first | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 5 lines changed or added | |||
matchspy.h | matchspy.h | |||
---|---|---|---|---|
skipping to change at line 128 | skipping to change at line 128 | |||
* | * | |||
* This method unserialises parameters serialised by the @a serialise( ) | * This method unserialises parameters serialised by the @a serialise( ) | |||
* method and allocates and returns a new object initialised with them . | * method and allocates and returns a new object initialised with them . | |||
* | * | |||
* If you don't want to support the remote backend in your match spy, you | * If you don't want to support the remote backend in your match spy, you | |||
* can use the default implementation which simply throws | * can use the default implementation which simply throws | |||
* Xapian::UnimplementedError. | * Xapian::UnimplementedError. | |||
* | * | |||
* Note that the returned object will be deallocated by Xapian after u se | * Note that the returned object will be deallocated by Xapian after u se | |||
* with "delete". It must therefore have been allocated with "new". | * with "delete". It must therefore have been allocated with "new". | |||
* | ||||
* @param s A string containing the serialised results. | ||||
* @param context Registry object to use for unserialisation to permit | ||||
* MatchSpy subclasses with sub-MatchSpy objects to be | ||||
* implemented. | ||||
*/ | */ | |||
virtual MatchSpy * unserialise(const std::string & s, | virtual MatchSpy * unserialise(const std::string & s, | |||
const Registry & context) const; | const Registry & context) const; | |||
/** Serialise the results of this match spy. | /** Serialise the results of this match spy. | |||
* | * | |||
* If you don't want to support the remote backend in your match spy, you | * If you don't want to support the remote backend in your match spy, you | |||
* can use the default implementation which simply throws | * can use the default implementation which simply throws | |||
* Xapian::UnimplementedError. | * Xapian::UnimplementedError. | |||
*/ | */ | |||
skipping to change at line 149 | skipping to change at line 154 | |||
/** Unserialise some results, and merge them into this matchspy. | /** Unserialise some results, and merge them into this matchspy. | |||
* | * | |||
* The order in which results are merged should not be significant, si nce | * The order in which results are merged should not be significant, si nce | |||
* this order is not specified (and will vary depending on the speed o f | * this order is not specified (and will vary depending on the speed o f | |||
* the search in each sub-database). | * the search in each sub-database). | |||
* | * | |||
* If you don't want to support the remote backend in your match spy, you | * If you don't want to support the remote backend in your match spy, you | |||
* can use the default implementation which simply throws | * can use the default implementation which simply throws | |||
* Xapian::UnimplementedError. | * Xapian::UnimplementedError. | |||
* | ||||
* @param s A string containing the serialised results. | ||||
*/ | */ | |||
virtual void merge_results(const std::string & s); | virtual void merge_results(const std::string & s); | |||
/** Return a string describing this object. | /** Return a string describing this object. | |||
* | * | |||
* This default implementation returns a generic answer, to avoid forc ing | * This default implementation returns a generic answer, to avoid forc ing | |||
* those deriving their own MatchSpy subclasses from having to impleme nt | * those deriving their own MatchSpy subclasses from having to impleme nt | |||
* this (they may not care what get_description() gives for their | * this (they may not care what get_description() gives for their | |||
* subclass). | * subclass). | |||
*/ | */ | |||
skipping to change at line 236 | skipping to change at line 243 | |||
TermIterator top_values_begin(size_t maxvalues) const; | TermIterator top_values_begin(size_t maxvalues) const; | |||
/** End iterator corresponding to top_values_begin() */ | /** End iterator corresponding to top_values_begin() */ | |||
TermIterator top_values_end(size_t) const { | TermIterator top_values_end(size_t) const { | |||
return TermIterator(); | return TermIterator(); | |||
} | } | |||
/** Implementation of virtual operator(). | /** Implementation of virtual operator(). | |||
* | * | |||
* This implementation tallies values for a matching document. | * This implementation tallies values for a matching document. | |||
* | ||||
* @param doc The document to tally values for. | ||||
* @param wt The weight of the document (ignored by this class). | ||||
*/ | */ | |||
void operator()(const Xapian::Document &doc, Xapian::weight wt); | void operator()(const Xapian::Document &doc, Xapian::weight wt); | |||
virtual MatchSpy * clone() const; | virtual MatchSpy * clone() const; | |||
virtual std::string name() const; | virtual std::string name() const; | |||
virtual std::string serialise() const; | virtual std::string serialise() const; | |||
virtual MatchSpy * unserialise(const std::string & s, | virtual MatchSpy * unserialise(const std::string & s, | |||
const Registry & context) const; | const Registry & context) const; | |||
virtual std::string serialise_results() const; | virtual std::string serialise_results() const; | |||
virtual void merge_results(const std::string & s); | virtual void merge_results(const std::string & s); | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 10 lines changed or added | |||
postingsource.h | postingsource.h | |||
---|---|---|---|---|
/** @file postingsource.h | /** @file postingsource.h | |||
* @brief External sources of posting information | * @brief External sources of posting information | |||
*/ | */ | |||
/* Copyright (C) 2007,2008,2009,2010 Olly Betts | /* Copyright (C) 2007,2008,2009,2010,2011 Olly Betts | |||
* Copyright (C) 2008,2009 Lemur Consulting Ltd | * Copyright (C) 2008,2009 Lemur Consulting Ltd | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
skipping to change at line 74 | skipping to change at line 74 | |||
* during iteration if the upper bound drops. | * during iteration if the upper bound drops. | |||
* | * | |||
* It is valid for the posting source to have returned a higher value from | * It is valid for the posting source to have returned a higher value from | |||
* get_weight() earlier in the iteration, but the posting source must not | * get_weight() earlier in the iteration, but the posting source must not | |||
* return a higher value from get_weight() than the currently set uppe r | * return a higher value from get_weight() than the currently set uppe r | |||
* bound, and the upper bound must not be increased (until init() has been | * bound, and the upper bound must not be increased (until init() has been | |||
* called). | * called). | |||
* | * | |||
* If you don't call this method, the upper bound will default to 0, f or | * If you don't call this method, the upper bound will default to 0, f or | |||
* convenience when implementing "weight-less" PostingSource subclasse s. | * convenience when implementing "weight-less" PostingSource subclasse s. | |||
* | ||||
* @param max_weight The upper bound to set. | ||||
*/ | */ | |||
void set_maxweight(Xapian::weight max_weight); | void set_maxweight(Xapian::weight max_weight); | |||
public: | public: | |||
/** @private @internal Set the object to inform of maxweight changes. | /** @private @internal Set the object to inform of maxweight changes. | |||
* | * | |||
* This method is for internal use only - it would be private except t hat | * This method is for internal use only - it would be private except t hat | |||
* would force us to forward declare an internal class in an external API | * would force us to forward declare an internal class in an external API | |||
* header just to make it a friend. | * header just to make it a friend. | |||
*/ | */ | |||
skipping to change at line 180 | skipping to change at line 182 | |||
* The default implementation calls next() repeatedly, which works but | * The default implementation calls next() repeatedly, which works but | |||
* skip_to() can often be implemented much more efficiently. | * skip_to() can often be implemented much more efficiently. | |||
* | * | |||
* Xapian will always call init() on a PostingSource before calling th is | * Xapian will always call init() on a PostingSource before calling th is | |||
* for the first time. | * for the first time. | |||
* | * | |||
* Note: in the case of a multi-database search, the docid specified i s | * Note: in the case of a multi-database search, the docid specified i s | |||
* the docid in the single subdatabase relevant to this posting source . | * the docid in the single subdatabase relevant to this posting source . | |||
* See the @a init() method for details. | * See the @a init() method for details. | |||
* | * | |||
* @param did The document id to advance to. | ||||
* @param min_wt The minimum weight contribution that is needed (this is | * @param min_wt The minimum weight contribution that is needed (this is | |||
* just a hint which subclasses may ignore). | * just a hint which subclasses may ignore). | |||
*/ | */ | |||
virtual void skip_to(Xapian::docid did, Xapian::weight min_wt); | virtual void skip_to(Xapian::docid did, Xapian::weight min_wt); | |||
/** Check if the specified docid occurs. | /** Check if the specified docid occurs. | |||
* | * | |||
* The caller is required to ensure that the specified document id @a did | * The caller is required to ensure that the specified document id @a did | |||
* actually exists in the database. If it does, it must move to that | * actually exists in the database. If it does, it must move to that | |||
* document id, and return true. If it does not, it may either: | * document id, and return true. If it does not, it may either: | |||
skipping to change at line 215 | skipping to change at line 218 | |||
* returning true if it is, and false if it isn't. | * returning true if it is, and false if it isn't. | |||
* | * | |||
* The default implementation calls skip_to() and always returns true. | * The default implementation calls skip_to() and always returns true. | |||
* | * | |||
* Xapian will always call init() on a PostingSource before calling th is | * Xapian will always call init() on a PostingSource before calling th is | |||
* for the first time. | * for the first time. | |||
* | * | |||
* Note: in the case of a multi-database search, the docid specified i s | * Note: in the case of a multi-database search, the docid specified i s | |||
* the docid in the single subdatabase relevant to this posting source . | * the docid in the single subdatabase relevant to this posting source . | |||
* See the @a init() method for details. | * See the @a init() method for details. | |||
* | ||||
* @param did The document id to check. | ||||
* @param min_wt The minimum weight contribution that is needed (this | ||||
is | ||||
* just a hint which subclasses may ignore). | ||||
*/ | */ | |||
virtual bool check(Xapian::docid did, Xapian::weight min_wt); | virtual bool check(Xapian::docid did, Xapian::weight min_wt); | |||
/** Return true if the current position is past the last entry in this list. | /** Return true if the current position is past the last entry in this list. | |||
* | * | |||
* At least one of @a next(), @a skip_to() or @a check() will be calle d | * At least one of @a next(), @a skip_to() or @a check() will be calle d | |||
* before this method is first called. | * before this method is first called. | |||
*/ | */ | |||
virtual bool at_end() const = 0; | virtual bool at_end() const = 0; | |||
skipping to change at line 503 | skipping to change at line 510 | |||
public: | public: | |||
/** Construct a ValueWeightPostingSource. | /** Construct a ValueWeightPostingSource. | |||
* | * | |||
* @param slot_ The value slot to read values from. | * @param slot_ The value slot to read values from. | |||
*/ | */ | |||
ValueMapPostingSource(Xapian::valueno slot_); | ValueMapPostingSource(Xapian::valueno slot_); | |||
/** Add a mapping. | /** Add a mapping. | |||
* | * | |||
* @param key The key looked up from the value slot. | * @param key The key looked up from the value slot. | |||
* @param weight The weight to give this key. | * @param wt The weight to give this key. | |||
*/ | */ | |||
void add_mapping(const std::string &key, double wt); | void add_mapping(const std::string &key, double wt); | |||
/** Clear all mappings. */ | /** Clear all mappings. */ | |||
void clear_mappings(); | void clear_mappings(); | |||
/** Set a default weight for document values not in the map. */ | /** Set a default weight for document values not in the map. | |||
* | ||||
* @param wt The weight to set as the default. | ||||
*/ | ||||
void set_default_weight(double wt); | void set_default_weight(double wt); | |||
Xapian::weight get_weight() const; | Xapian::weight get_weight() const; | |||
ValueMapPostingSource * clone() const; | ValueMapPostingSource * clone() const; | |||
std::string name() const; | std::string name() const; | |||
std::string serialise() const; | std::string serialise() const; | |||
ValueMapPostingSource * unserialise(const std::string &s) const; | ValueMapPostingSource * unserialise(const std::string &s) const; | |||
void init(const Database & db_); | void init(const Database & db_); | |||
std::string get_description() const; | std::string get_description() const; | |||
End of changes. 6 change blocks. | ||||
3 lines changed or deleted | 14 lines changed or added | |||
queryparser.h | queryparser.h | |||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
#include <string> | #include <string> | |||
namespace Xapian { | namespace Xapian { | |||
class Database; | class Database; | |||
class Stem; | class Stem; | |||
/// Base class for stop-word decision functor. | /// Base class for stop-word decision functor. | |||
class XAPIAN_VISIBILITY_DEFAULT Stopper { | class XAPIAN_VISIBILITY_DEFAULT Stopper { | |||
public: | public: | |||
/// Is term a stop-word? | /** Is term a stop-word? | |||
* | ||||
* @param term The term to test. | ||||
*/ | ||||
virtual bool operator()(const std::string & term) const = 0; | virtual bool operator()(const std::string & term) const = 0; | |||
/// Class has virtual methods, so provide a virtual destructor. | /// Class has virtual methods, so provide a virtual destructor. | |||
virtual ~Stopper() { } | virtual ~Stopper() { } | |||
/// Return a string describing this object. | /// Return a string describing this object. | |||
virtual std::string get_description() const; | virtual std::string get_description() const; | |||
}; | }; | |||
/// Simple implementation of Stopper class - this will suit most users. | /// Simple implementation of Stopper class - this will suit most users. | |||
skipping to change at line 76 | skipping to change at line 79 | |||
// pointing to const char *. | // pointing to const char *. | |||
template <class Iterator> | template <class Iterator> | |||
SimpleStopper(Iterator begin, Iterator end) { | SimpleStopper(Iterator begin, Iterator end) { | |||
while (begin != end) stop_words.insert(*begin++); | while (begin != end) stop_words.insert(*begin++); | |||
} | } | |||
#endif | #endif | |||
/// Add a single stop word. | /// Add a single stop word. | |||
void add(const std::string & word) { stop_words.insert(word); } | void add(const std::string & word) { stop_words.insert(word); } | |||
/// Is term a stop-word? | ||||
virtual bool operator()(const std::string & term) const { | virtual bool operator()(const std::string & term) const { | |||
return stop_words.find(term) != stop_words.end(); | return stop_words.find(term) != stop_words.end(); | |||
} | } | |||
/// Return a string describing this object. | ||||
virtual std::string get_description() const; | virtual std::string get_description() const; | |||
}; | }; | |||
/// Base class for value range processors. | /// Base class for value range processors. | |||
struct XAPIAN_VISIBILITY_DEFAULT ValueRangeProcessor { | struct XAPIAN_VISIBILITY_DEFAULT ValueRangeProcessor { | |||
/// Destructor. | /// Destructor. | |||
virtual ~ValueRangeProcessor(); | virtual ~ValueRangeProcessor(); | |||
/** Check for a valid range of this type. | /** Check for a valid range of this type. | |||
* | * | |||
* If this ValueRangeProcessor recognises BEGIN..END it returns the | * @param[in,out] begin The start of the range as specified in the q | |||
* value number to range filter on. Otherwise it returns | uery | |||
* Xapian::BAD_VALUENO. | * string by the user. This parameter is a | |||
* non-const reference so the ValueRangeProcess | ||||
or | ||||
* can modify it to return the value to start t | ||||
he | ||||
* range with. | ||||
* @param[in,out] end The end of the range. This is also a non-co | ||||
nst | ||||
* reference so it can be modified. | ||||
* | ||||
* @return If this ValueRangeProcessor recognises the range BEG | ||||
IN..END it | ||||
* returns the value slot number to range filter on. Otherwise | ||||
it | ||||
* returns Xapian::BAD_VALUENO. | ||||
*/ | */ | |||
virtual Xapian::valueno operator()(std::string &begin, std::string &end ) = 0; | virtual Xapian::valueno operator()(std::string &begin, std::string &end ) = 0; | |||
}; | }; | |||
/** Handle a string range. | /** Handle a string range. | |||
* | * | |||
* The end points can be any strings. | * The end points can be any strings. | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT StringValueRangeProcessor : public ValueRan geProcessor { | class XAPIAN_VISIBILITY_DEFAULT StringValueRangeProcessor : public ValueRan geProcessor { | |||
protected: | protected: | |||
skipping to change at line 131 | skipping to change at line 140 | |||
* @param slot_ The value number to return from operator(). | * @param slot_ The value number to return from operator(). | |||
* @param str_ A string to look for to recognise values as belongi ng | * @param str_ A string to look for to recognise values as belongi ng | |||
* to this range. | * to this range. | |||
* @param prefix_ Flag specifying whether to check for str_ as a prefi x | * @param prefix_ Flag specifying whether to check for str_ as a prefi x | |||
* or a suffix. | * or a suffix. | |||
*/ | */ | |||
StringValueRangeProcessor(Xapian::valueno slot_, const std::string &str _, | StringValueRangeProcessor(Xapian::valueno slot_, const std::string &str _, | |||
bool prefix_ = true) | bool prefix_ = true) | |||
: valno(slot_), prefix(prefix_), str(str_) { } | : valno(slot_), prefix(prefix_), str(str_) { } | |||
/** Check for a valid range of this type. | /** Check for a valid string range. | |||
* | * | |||
* If no prefix or suffix is specified, then this always returns the | * @param[in,out] begin The start of the range as specified in the | |||
* value slot specified at construction time. | * query string by the user. This parameter is | |||
a | ||||
* non-const reference so the ValueRangeProcess | ||||
or | ||||
* can modify it to return the value to start t | ||||
he | ||||
* range with. | ||||
* @param[in,out] end The end of the range. This is also a non-co | ||||
nst | ||||
* reference so it can be modified. | ||||
* | * | |||
* If a prefix or suffix is specified, this is checked for first, and | * @return A StringValueRangeProcessor always accepts a range i | |||
* it it doesn't match, this method returns Xapian::BAD_VALUENO. | t is | |||
* offered, and returns the value of slot_ passed at constructi | ||||
on | ||||
* time. It doesn't modify @a begin or @a end. | ||||
*/ | */ | |||
Xapian::valueno operator()(std::string &, std::string &); | Xapian::valueno operator()(std::string &begin, std::string &end); | |||
}; | }; | |||
/** Handle a date range. | /** Handle a date range. | |||
* | * | |||
* Begin and end must be dates in a recognised format. | * Begin and end must be dates in a recognised format. | |||
*/ | */ | |||
class XAPIAN_VISIBILITY_DEFAULT DateValueRangeProcessor : public StringValu eRangeProcessor { | class XAPIAN_VISIBILITY_DEFAULT DateValueRangeProcessor : public StringValu eRangeProcessor { | |||
bool prefer_mdy; | bool prefer_mdy; | |||
int epoch_year; | int epoch_year; | |||
skipping to change at line 209 | skipping to change at line 224 | |||
* For example, if str_ is "created:" and prefix_ is true, and the ran ge | * For example, if str_ is "created:" and prefix_ is true, and the ran ge | |||
* processor has been added to the queryparser, the queryparser will | * processor has been added to the queryparser, the queryparser will | |||
* accept "created:1/1/2000..31/12/2001". | * accept "created:1/1/2000..31/12/2001". | |||
*/ | */ | |||
DateValueRangeProcessor(Xapian::valueno slot_, const std::string &str_, | DateValueRangeProcessor(Xapian::valueno slot_, const std::string &str_, | |||
bool prefix_ = true, | bool prefix_ = true, | |||
bool prefer_mdy_ = false, int epoch_year_ = 1970 ) | bool prefer_mdy_ = false, int epoch_year_ = 1970 ) | |||
: StringValueRangeProcessor(slot_, str_, prefix_), | : StringValueRangeProcessor(slot_, str_, prefix_), | |||
prefer_mdy(prefer_mdy_), epoch_year(epoch_year_) { } | prefer_mdy(prefer_mdy_), epoch_year(epoch_year_) { } | |||
/** Check for a valid range of this type. | /** Check for a valid date range. | |||
* | * | |||
* If BEGIN..END is a sensible date range, this method returns the | * @param[in,out] begin The start of the range as specified in the | |||
* value number of range filter on. Otherwise it returns | * query string by the user. This parameter is | |||
* Xapian::BAD_VALUENO. | a | |||
* non-const reference so the ValueRangeProcess | ||||
or | ||||
* can modify it to return the value to start t | ||||
he | ||||
* range with. | ||||
* @param[in,out] end The end of the range. This is also a non-co | ||||
nst | ||||
* reference so it can be modified. | ||||
* | ||||
* @return If BEGIN..END is a sensible date range, this method | ||||
modifies | ||||
* them into the format YYYYMMDD and returns the value of slot_ | ||||
* passed at construction time. Otherwise it returns | ||||
* Xapian::BAD_VALUENO. | ||||
*/ | */ | |||
Xapian::valueno operator()(std::string &begin, std::string &end); | Xapian::valueno operator()(std::string &begin, std::string &end); | |||
}; | }; | |||
/** Handle a number range. | /** Handle a number range. | |||
* | * | |||
* This class must be used on values which have been encoded using | * This class must be used on values which have been encoded using | |||
* Xapian::sortable_serialise() which turns numbers into strings which | * Xapian::sortable_serialise() which turns numbers into strings which | |||
* will sort in the same order as the numbers (the same values can be | * will sort in the same order as the numbers (the same values can be | |||
* used to implement a numeric sort). | * used to implement a numeric sort). | |||
skipping to change at line 270 | skipping to change at line 294 | |||
* processor has been added to the queryparser, the queryparser will | * processor has been added to the queryparser, the queryparser will | |||
* accept "$10..50" or "$10..$50", but not "10..50" or "10..$50" as va lid | * accept "$10..50" or "$10..$50", but not "10..50" or "10..$50" as va lid | |||
* ranges. If str_ is "kg" and prefix_ is false, the queryparser will | * ranges. If str_ is "kg" and prefix_ is false, the queryparser will | |||
* accept "10..50kg" or "10kg..50kg", but not "10..50" or "10kg..50" a s | * accept "10..50kg" or "10kg..50kg", but not "10..50" or "10kg..50" a s | |||
* valid ranges. | * valid ranges. | |||
*/ | */ | |||
NumberValueRangeProcessor(Xapian::valueno slot_, const std::string &str _, | NumberValueRangeProcessor(Xapian::valueno slot_, const std::string &str _, | |||
bool prefix_ = true) | bool prefix_ = true) | |||
: StringValueRangeProcessor(slot_, str_, prefix_) { } | : StringValueRangeProcessor(slot_, str_, prefix_) { } | |||
/** Check for a valid range of this type. | /** Check for a valid numeric range. | |||
* | * | |||
* If BEGIN..END is a valid numeric value range, and has the | * @param[in,out] begin The start of the range as specified in the | |||
* appropriate prefix or suffix (if specified) required for this | * query string by the user. This parameter is | |||
* NumberValueRangeProcessor, this method returns the value number of | a | |||
* range filter on, and sets begin and end to the appropriate serialis | * non-const reference so the ValueRangeProcess | |||
ed | or | |||
* values needed to delimit the range. Otherwise it returns | * can modify it to return the value to start t | |||
* Xapian::BAD_VALUENO. | he | |||
* range with. | ||||
* @param[in,out] end The end of the range. This is also a non-co | ||||
nst | ||||
* reference so it can be modified. | ||||
* | ||||
* @return If BEGIN..END is a valid numeric range with the spec | ||||
ified | ||||
* prefix/suffix (if one was specified), this method modifies | ||||
* them by removing the prefix/suffix, converting to a number, | ||||
* and encoding with Xapian::sortable_serialise(), and returns | ||||
the | ||||
* value of slot_ passed at construction time. Otherwise it | ||||
* returns Xapian::BAD_VALUENO. | ||||
*/ | */ | |||
Xapian::valueno operator()(std::string &begin, std::string &end); | Xapian::valueno operator()(std::string &begin, std::string &end); | |||
}; | }; | |||
/// Build a Xapian::Query object from a user query string. | /// Build a Xapian::Query object from a user query string. | |||
class XAPIAN_VISIBILITY_DEFAULT QueryParser { | class XAPIAN_VISIBILITY_DEFAULT QueryParser { | |||
public: | public: | |||
/// Class representing the queryparser internals. | /// Class representing the queryparser internals. | |||
class Internal; | class Internal; | |||
/// @private @internal Reference counted internals. | /// @private @internal Reference counted internals. | |||
skipping to change at line 373 | skipping to change at line 405 | |||
/** Enable automatic use of synonyms for single terms and groups of | /** Enable automatic use of synonyms for single terms and groups of | |||
* terms. | * terms. | |||
* | * | |||
* NB: You must also call set_database() for this to work. | * NB: You must also call set_database() for this to work. | |||
*/ | */ | |||
FLAG_AUTO_MULTIWORD_SYNONYMS = 1024 | FLAG_AUTO_SYNONYMS, | FLAG_AUTO_MULTIWORD_SYNONYMS = 1024 | FLAG_AUTO_SYNONYMS, | |||
/** The default flags. | /** The default flags. | |||
* | * | |||
* Used if you don't explicitly pass any to @a parse_query(). | * Used if you don't explicitly pass any to @a parse_query(). | |||
* The default flags are FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE. | ||||
* | * | |||
* Added in Xapian 1.0.11. | * Added in Xapian 1.0.11. | |||
*/ | */ | |||
FLAG_DEFAULT = FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE | FLAG_DEFAULT = FLAG_PHRASE|FLAG_BOOLEAN|FLAG_LOVEHATE | |||
} feature_flag; | } feature_flag; | |||
typedef enum { STEM_NONE, STEM_SOME, STEM_ALL } stem_strategy; | typedef enum { STEM_NONE, STEM_SOME, STEM_ALL } stem_strategy; | |||
/// Copy constructor. | /// Copy constructor. | |||
QueryParser(const QueryParser & o); | QueryParser(const QueryParser & o); | |||
skipping to change at line 400 | skipping to change at line 433 | |||
/// Destructor. | /// Destructor. | |||
~QueryParser(); | ~QueryParser(); | |||
/** Set the stemmer. | /** Set the stemmer. | |||
* | * | |||
* This sets the stemming algorithm which will be used by the query | * This sets the stemming algorithm which will be used by the query | |||
* parser. Note that the stemming algorithm will only be used accordi ng | * parser. Note that the stemming algorithm will only be used accordi ng | |||
* to the stemming strategy set by set_stemming_strategy(), which defa ults | * to the stemming strategy set by set_stemming_strategy(), which defa ults | |||
* to STEM_NONE. Therefore, to use a stemming algorithm, you will als o | * to STEM_NONE. Therefore, to use a stemming algorithm, you will als o | |||
* need to call set_stemming_strategy() with a value other than STEM_N ONE. | * need to call set_stemming_strategy() with a value other than STEM_N ONE. | |||
* | ||||
* @param stemmer The Xapian::Stem object to set. | ||||
*/ | */ | |||
void set_stemmer(const Xapian::Stem & stemmer); | void set_stemmer(const Xapian::Stem & stemmer); | |||
/** Set the stemming strategy. | /** Set the stemming strategy. | |||
* | * | |||
* This controls how the query parser will apply the stemming algorith m. | * This controls how the query parser will apply the stemming algorith m. | |||
* The default value is STEM_NONE. The possible values are: | * Note that the stemming algorithm is only applied to words in | |||
* probabilistic fields - boolean filter terms are never stemmed. | ||||
* | * | |||
* - STEM_NONE: Don't perform any stemming. | * @param strategy The strategy to use - possible values are: | |||
* - STEM_NONE: Don't perform any stemming (the default). | ||||
* - STEM_SOME: Search for stemmed forms of terms except for those wh ich | * - STEM_SOME: Search for stemmed forms of terms except for those wh ich | |||
* start with a capital letter, or are followed by certai n | * start with a capital letter, or are followed by certai n | |||
* characters (currently: (/\@<>=*[{" ), or are used with | * characters (currently: (/\@<>=*[{" ), or are used with | |||
* operators which need positional information. Stemmed | * operators which need positional information. Stemmed | |||
* terms are prefixed with 'Z'. | * terms are prefixed with 'Z'. | |||
* - STEM_ALL: Search for stemmed forms of all words (note: no 'Z' | * - STEM_ALL: Search for stemmed forms of all words (note: no 'Z' | |||
* prefix is added). | * prefix is added). | |||
* | ||||
* Note that the stemming algorithm is only applied to words in | ||||
* probabilistic fields - boolean filter terms are never stemmed. | ||||
*/ | */ | |||
void set_stemming_strategy(stem_strategy strategy); | void set_stemming_strategy(stem_strategy strategy); | |||
/// Set the stopper. | /** Set the stopper. | |||
* | ||||
* @param stop The Stopper object to set (default NULL, which means | ||||
no | ||||
* stopwords). | ||||
*/ | ||||
void set_stopper(const Stopper *stop = NULL); | void set_stopper(const Stopper *stop = NULL); | |||
/** Set the default operator. | /** Set the default operator. | |||
* | * | |||
* This operator is used to combine non-filter query items when no | * @param default_op The operator to use to combine non-filter | |||
* explicit operator is used. | * query items when no explicit operator is use | |||
d. | ||||
* | * | |||
* The most useful values for this are OP_OR (the default) and OP_AND. | * The most useful values for this are OP_OR (t | |||
* OP_NEAR and OP_PHRASE can also be useful. | he | |||
* default) and OP_AND. OP_NEAR and OP_PHRASE | ||||
can | ||||
* also be useful. | ||||
* | * | |||
* So for example, 'weather forecast' is parsed as if it were 'weather | * So for example, 'weather forecast' is parsed | |||
OR | as | |||
* forecast' by default. | * if it were 'weather OR forecast' by default. | |||
*/ | */ | |||
void set_default_op(Query::op default_op); | void set_default_op(Query::op default_op); | |||
/** Get the current default operator. */ | /** Get the current default operator. */ | |||
Query::op get_default_op() const; | Query::op get_default_op() const; | |||
/** Specify the database being searched. | /** Specify the database being searched. | |||
* | * | |||
* The database is used for wildcard expansion (FLAG_WILDCARD and | * @param db The database to use for wildcard expansion | |||
* FLAG_PARTIAL), spelling correction (FLAG_SPELLING_CORRECTION), and | * (FLAG_WILDCARD and FLAG_PARTIAL), spelling correctio | |||
* synonyms (FLAG_SYNONYM, FLAG_AUTO_SYNONYMS, and | n | |||
* FLAG_AUTO_MULTIWORD_SYNONYMS). | * (FLAG_SPELLING_CORRECTION), and synonyms (FLAG_SYNON | |||
YM, | ||||
* FLAG_AUTO_SYNONYMS, and FLAG_AUTO_MULTIWORD_SYNONYMS | ||||
). | ||||
*/ | */ | |||
void set_database(const Database &db); | void set_database(const Database &db); | |||
/** Specify the maximum expansion of a wildcard term. | /** Specify the maximum expansion of a wildcard term. | |||
* | * | |||
* Note: you must also set FLAG_WILDCARD for wildcard expansion to hap pen. | * Note: you must also set FLAG_WILDCARD for wildcard expansion to hap pen. | |||
* | * | |||
* @param limit The maximum number of terms each wildcard in the que ry | * @param limit The maximum number of terms each wildcard in the que ry | |||
* can expand to, or 0 for no limit (which is the defau lt). | * can expand to, or 0 for no limit (which is the defau lt). | |||
*/ | */ | |||
skipping to change at line 476 | skipping to change at line 515 | |||
* For example, you can pass "A" when parsing an "Author" field . | * For example, you can pass "A" when parsing an "Author" field . | |||
* | * | |||
* @exception If the query string can't be parsed, then | * @exception If the query string can't be parsed, then | |||
* Xapian::QueryParserError is thrown. You can get an Engli sh | * Xapian::QueryParserError is thrown. You can get an Engli sh | |||
* error message to report to the user by catching it and | * error message to report to the user by catching it and | |||
* calling get_msg() on the caught exception. The current | * calling get_msg() on the caught exception. The current | |||
* possible values (in case you want to translate them) are: | * possible values (in case you want to translate them) are: | |||
* | * | |||
* @li Unknown range operation | * @li Unknown range operation | |||
* @li parse error | * @li parse error | |||
* @li Syntax: <expression> AND <expression> | * @li Syntax: <expression> AND <expression> | |||
* @li Syntax: <expression> AND NOT <expression> | ; | |||
* @li Syntax: <expression> NOT <expression> | * @li Syntax: <expression> AND NOT <expressio | |||
* @li Syntax: <expression> OR <expression> | n> | |||
* @li Syntax: <expression> XOR <expression> | * @li Syntax: <expression> NOT <expression> | |||
; | ||||
* @li Syntax: <expression> OR <expression> | ||||
* @li Syntax: <expression> XOR <expression> | ||||
; | ||||
*/ | */ | |||
Query parse_query(const std::string &query_string, | Query parse_query(const std::string &query_string, | |||
unsigned flags = FLAG_DEFAULT, | unsigned flags = FLAG_DEFAULT, | |||
const std::string &default_prefix = std::string()); | const std::string &default_prefix = std::string()); | |||
/** Add a probabilistic term prefix. | /** Add a probabilistic term prefix. | |||
* | * | |||
* For example: | * For example: | |||
* | * | |||
* @code | * @code | |||
skipping to change at line 637 | skipping to change at line 676 | |||
* specified by IEEE_754, this will be the case: if the representation of | * 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 | * doubles is more precise, it is possible that two very close doubles | |||
* will be mapped to the same string, so will compare equal. | * will be mapped to the same string, so will compare equal. | |||
* | * | |||
* Note also that both zero and -zero will be converted to the same | * Note also that both zero and -zero will be converted to the same | |||
* representation: since these compare equal, this satisfies the | * representation: since these compare equal, this satisfies the | |||
* comparison constraint, but it's worth knowing this if you wish to use | * comparison constraint, but it's worth knowing this if you wish to use | |||
* the encoding in some situation where this distinction matters. | * the encoding in some situation where this distinction matters. | |||
* | * | |||
* Handling of NaN isn't (currently) guaranteed to be sensible. | * Handling of NaN isn't (currently) guaranteed to be sensible. | |||
* | ||||
* @param value The number to serialise. | ||||
*/ | */ | |||
XAPIAN_VISIBILITY_DEFAULT | XAPIAN_VISIBILITY_DEFAULT | |||
std::string sortable_serialise(double value); | std::string sortable_serialise(double value); | |||
/** Convert a string encoded using @a sortable_serialise back to a floating | /** Convert a string encoded using @a sortable_serialise back to a floating | |||
* point number. | * point number. | |||
* | * | |||
* This expects the input to be a string produced by @a sortable_serialise (). | * This expects the input to be a string produced by @a sortable_serialise (). | |||
* If the input is not such a string, the value returned is undefined (but | * If the input is not such a string, the value returned is undefined (but | |||
* no error will be thrown). | * no error will be thrown). | |||
* | * | |||
* The result of the conversion will be exactly the value which was | * The result of the conversion will be exactly the value which was | |||
* supplied to @a sortable_serialise() when making the string on platforms | * supplied to @a sortable_serialise() when making the string on platforms | |||
* which represent doubles with the precisions specified by IEEE_754, but | * which represent doubles with the precisions specified by IEEE_754, but | |||
* may be a different (nearby) value on other platforms. | * may be a different (nearby) value on other platforms. | |||
* | ||||
* @param value The serialised string to decode. | ||||
*/ | */ | |||
XAPIAN_VISIBILITY_DEFAULT | XAPIAN_VISIBILITY_DEFAULT | |||
double sortable_unserialise(const std::string & value); | double sortable_unserialise(const std::string & value); | |||
} | } | |||
#endif // XAPIAN_INCLUDED_QUERYPARSER_H | #endif // XAPIAN_INCLUDED_QUERYPARSER_H | |||
End of changes. 25 change blocks. | ||||
46 lines changed or deleted | 122 lines changed or added | |||
registry.h | registry.h | |||
---|---|---|---|---|
/** @file registry.h | /** @file registry.h | |||
* @brief Class for looking up user subclasses during unserialisation. | * @brief Class for looking up user subclasses during unserialisation. | |||
*/ | */ | |||
/* Copyright 2009 Lemur Consulting Ltd | /* Copyright 2009 Lemur Consulting Ltd | |||
* Copyright 2009 Olly Betts | * Copyright 2009,2011 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 55 | skipping to change at line 55 | |||
class Internal; | class Internal; | |||
private: | private: | |||
/// @internal Reference counted internals. | /// @internal Reference counted internals. | |||
Xapian::Internal::RefCntPtr<Internal> internal; | Xapian::Internal::RefCntPtr<Internal> internal; | |||
public: | public: | |||
/** Copy constructor. | /** Copy constructor. | |||
* | * | |||
* The internals are reference counted, so copying is cheap. | * The internals are reference counted, so copying is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
Registry(const Registry & other); | Registry(const Registry & other); | |||
/** Assignment operator. | /** Assignment operator. | |||
* | * | |||
* The internals are reference counted, so assignment is cheap. | * The internals are reference counted, so assignment is cheap. | |||
* | ||||
* @param other The object to copy. | ||||
*/ | */ | |||
Registry & operator=(const Registry & other); | Registry & operator=(const Registry & other); | |||
/** Default constructor. | /** Default constructor. | |||
* | * | |||
* The registry will contain all standard subclasses of user-subclassa ble | * The registry will contain all standard subclasses of user-subclassa ble | |||
* classes. | * classes. | |||
*/ | */ | |||
Registry(); | Registry(); | |||
~Registry(); | ~Registry(); | |||
/// Register a weighting scheme. | /** Register a weighting scheme. | |||
* | ||||
* @param wt The weighting scheme to register. | ||||
*/ | ||||
void register_weighting_scheme(const Xapian::Weight &wt); | void register_weighting_scheme(const Xapian::Weight &wt); | |||
/** Get the weighting scheme given a name. | /** Get the weighting scheme given a name. | |||
* | * | |||
* The returned weighting scheme is owned by the registry object. | * @param name The name of the weighting scheme to find. | |||
* | * @return An object with the requested name, or NULL i | |||
* Returns NULL if the weighting scheme could not be found. | f the | |||
* weighting scheme could not be found. The returned | ||||
* object is owned by the registry and so must not be | ||||
* deleted by the caller. | ||||
*/ | */ | |||
const Xapian::Weight * | const Xapian::Weight * | |||
get_weighting_scheme(const std::string & name) const; | get_weighting_scheme(const std::string & name) const; | |||
/// Register a user-defined posting source class. | /** Register a user-defined posting source class. | |||
* | ||||
* @param source The posting source to register. | ||||
*/ | ||||
void register_posting_source(const Xapian::PostingSource &source); | void register_posting_source(const Xapian::PostingSource &source); | |||
/** Get a posting source given a name. | /** Get a posting source given a name. | |||
* | * | |||
* The returned posting source is owned by the registry object. | * @param name The name of the posting source to find. | |||
* | * @return An object with the requested name, or NULL i | |||
* Returns NULL if the posting source could not be found. | f the | |||
* posting source could not be found. The returned | ||||
* object is owned by the registry and so must not be | ||||
* deleted by the caller. | ||||
*/ | */ | |||
const Xapian::PostingSource * | const Xapian::PostingSource * | |||
get_posting_source(const std::string & name) const; | get_posting_source(const std::string & name) const; | |||
/// Register a user-defined match spy class. | /** Register a user-defined match spy class. | |||
* | ||||
* @param spy The match spy to register. | ||||
*/ | ||||
void register_match_spy(const Xapian::MatchSpy &spy); | void register_match_spy(const Xapian::MatchSpy &spy); | |||
/** Get a match spy given a name. | /** Get a match spy given a name. | |||
* | * | |||
* The returned match spy is owned by the registry object. | * @param name The name of the match spy to find. | |||
* | * @return An object with the requested name, or NULL i | |||
* Returns NULL if the match spy could not be found. | f the | |||
* match spy could not be found. The returned | ||||
* object is owned by the registry and so must not be | ||||
* deleted by the caller. | ||||
*/ | */ | |||
const Xapian::MatchSpy * | const Xapian::MatchSpy * | |||
get_match_spy(const std::string & name) const; | get_match_spy(const std::string & name) const; | |||
}; | }; | |||
} | } | |||
#endif /* XAPIAN_INCLUDED_REGISTRY_H */ | #endif /* XAPIAN_INCLUDED_REGISTRY_H */ | |||
End of changes. 9 change blocks. | ||||
13 lines changed or deleted | 35 lines changed or added | |||
stem.h | stem.h | |||
---|---|---|---|---|
skipping to change at line 105 | skipping to change at line 105 | |||
* language isn't recognised. | * language isn't recognised. | |||
*/ | */ | |||
explicit Stem(const std::string &language); | explicit Stem(const std::string &language); | |||
/** Construct a Xapian::Stem object with a user-provided stemming algor ithm. | /** Construct a Xapian::Stem object with a user-provided stemming algor ithm. | |||
* | * | |||
* You can subclass Xapian::StemImplementation to implement your own | * You can subclass Xapian::StemImplementation to implement your own | |||
* stemming algorithm (or to wrap a third-party algorithm) and then wr ap | * stemming algorithm (or to wrap a third-party algorithm) and then wr ap | |||
* your implementation in a Xapian::Stem object to pass to the Xapian API. | * your implementation in a Xapian::Stem object to pass to the Xapian API. | |||
* | * | |||
* The StemImplementation object is reference counted, and so will be | * @param p The user-subclassed StemImplementation object. This | |||
* automatically deleted by the Xapian::Stem wrapper when no longer | * is reference counted, and so will be automatically | |||
* required. | * deleted by the Xapian::Stem wrapper when no longer | |||
* required. | ||||
*/ | */ | |||
explicit Stem(StemImplementation * p); | explicit Stem(StemImplementation * p); | |||
/// Destructor. | /// Destructor. | |||
~Stem(); | ~Stem(); | |||
/** Stem a word. | /** Stem a word. | |||
* | * | |||
* @param word a word to stem. | * @param word a word to stem. | |||
* @return the stem | * @return the stem | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added | |||
termgenerator.h | termgenerator.h | |||
---|---|---|---|---|
/** @file termgenerator.h | /** @file termgenerator.h | |||
* @brief parse free text and generate terms | * @brief parse free text and generate terms | |||
*/ | */ | |||
/* Copyright (C) 2007,2009 Olly Betts | /* Copyright (C) 2007,2009,2011 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 70 | skipping to change at line 70 | |||
/// Destructor. | /// Destructor. | |||
~TermGenerator(); | ~TermGenerator(); | |||
/// Set the Xapian::Stem object to be used for generating stemmed terms . | /// Set the Xapian::Stem object to be used for generating stemmed terms . | |||
void set_stemmer(const Xapian::Stem & stemmer); | void set_stemmer(const Xapian::Stem & stemmer); | |||
/** Set the Xapian::Stopper object to be used for identifying stopwords . | /** Set the Xapian::Stopper object to be used for identifying stopwords . | |||
* | * | |||
* Stemmed forms of stopwords aren't indexed, but unstemmed forms stil l | * Stemmed forms of stopwords aren't indexed, but unstemmed forms stil l | |||
* are so that searches for phrases including stop words still work. | * are so that searches for phrases including stop words still work. | |||
* | ||||
* @param stop The Stopper object to set (default NULL, which means | ||||
no | ||||
* stopwords). | ||||
*/ | */ | |||
void set_stopper(const Xapian::Stopper *stop = NULL); | void set_stopper(const Xapian::Stopper *stop = NULL); | |||
/// Set the current document. | /// Set the current document. | |||
void set_document(const Xapian::Document & doc); | void set_document(const Xapian::Document & doc); | |||
/// Get the current document. | /// Get the current document. | |||
const Xapian::Document & get_document() const; | const Xapian::Document & get_document() const; | |||
/// Set the database to index spelling data to. | /// Set the database to index spelling data to. | |||
skipping to change at line 104 | skipping to change at line 107 | |||
* | * | |||
* @param toggle Flags to XOR. | * @param toggle Flags to XOR. | |||
* @param mask Flags to AND with first. | * @param mask Flags to AND with first. | |||
* | * | |||
* @return The old flags setting. | * @return The old flags setting. | |||
*/ | */ | |||
flags set_flags(flags toggle, flags mask = flags(0)); | flags set_flags(flags toggle, flags mask = flags(0)); | |||
/** Index some text. | /** Index some text. | |||
* | * | |||
* @param itor Utf8Iterator pointing to the text to index. | ||||
* @param wdf_inc The wdf increment (default 1). | * @param wdf_inc The wdf increment (default 1). | |||
* @param prefix The term prefix to use (default is no prefix). | * @param prefix The term prefix to use (default is no prefix). | |||
*/ | */ | |||
void index_text(const Xapian::Utf8Iterator & itor, | void index_text(const Xapian::Utf8Iterator & itor, | |||
Xapian::termcount wdf_inc = 1, | Xapian::termcount wdf_inc = 1, | |||
const std::string & prefix = std::string()); | const std::string & prefix = std::string()); | |||
/** Index some text in a std::string. | /** Index some text in a std::string. | |||
* | * | |||
* @param text The text to index. | ||||
* @param wdf_inc The wdf increment (default 1). | * @param wdf_inc The wdf increment (default 1). | |||
* @param prefix The term prefix to use (default is no prefix). | * @param prefix The term prefix to use (default is no prefix). | |||
*/ | */ | |||
void index_text(const std::string & text, | void index_text(const std::string & text, | |||
Xapian::termcount wdf_inc = 1, | Xapian::termcount wdf_inc = 1, | |||
const std::string & prefix = std::string()) { | const std::string & prefix = std::string()) { | |||
return index_text(Utf8Iterator(text), wdf_inc, prefix); | return index_text(Utf8Iterator(text), wdf_inc, prefix); | |||
} | } | |||
/** Index some text without positional information. | /** Index some text without positional information. | |||
* | * | |||
* Just like index_text, but no positional information is generated. T his | * Just like index_text, but no positional information is generated. T his | |||
* means that the database will be significantly smaller, but that phra se | * means that the database will be significantly smaller, but that phra se | |||
* searching and NEAR won't be supported. | * searching and NEAR won't be supported. | |||
* | ||||
* @param itor Utf8Iterator pointing to the text to index. | ||||
* @param wdf_inc The wdf increment (default 1). | ||||
* @param prefix The term prefix to use (default is no prefix). | ||||
*/ | */ | |||
void index_text_without_positions(const Xapian::Utf8Iterator & itor, | void index_text_without_positions(const Xapian::Utf8Iterator & itor, | |||
Xapian::termcount wdf_inc = 1, | Xapian::termcount wdf_inc = 1, | |||
const std::string & prefix = std::stri ng()); | const std::string & prefix = std::stri ng()); | |||
/** Index some text in a std::string without positional information. | /** Index some text in a std::string without positional information. | |||
* | * | |||
* Just like index_text, but no positional information is generated. T his | * Just like index_text, but no positional information is generated. T his | |||
* means that the database will be significantly smaller, but that phra se | * means that the database will be significantly smaller, but that phra se | |||
* searching and NEAR won't be supported. | * searching and NEAR won't be supported. | |||
* | ||||
* @param text The text to index. | ||||
* @param wdf_inc The wdf increment (default 1). | ||||
* @param prefix The term prefix to use (default is no prefix). | ||||
*/ | */ | |||
void index_text_without_positions(const std::string & text, | void index_text_without_positions(const std::string & text, | |||
Xapian::termcount wdf_inc = 1, | Xapian::termcount wdf_inc = 1, | |||
const std::string & prefix = std::stri ng()) { | const std::string & prefix = std::stri ng()) { | |||
return index_text_without_positions(Utf8Iterator(text), wdf_inc, pre fix); | return index_text_without_positions(Utf8Iterator(text), wdf_inc, pre fix); | |||
} | } | |||
/** Increase the termpos used by index_text by @a delta. | /** Increase the term position used by index_text. | |||
* | * | |||
* This can be used to prevent phrase searches from spanning two | * This can be used between indexing text from different fields or oth | |||
* unconnected blocks of text (e.g. the title and body text). | er | |||
* places to prevent phrase searches from spanning between them (e.g. | ||||
* between the title and body text, or between two chapters in a book) | ||||
. | ||||
* | ||||
* @param delta Amount to increase the term position by (default: 10 | ||||
0). | ||||
*/ | */ | |||
void increase_termpos(Xapian::termcount delta = 100); | void increase_termpos(Xapian::termcount delta = 100); | |||
/// Get the current term position. | /// Get the current term position. | |||
Xapian::termcount get_termpos() const; | Xapian::termcount get_termpos() const; | |||
/// Set the current term position. | /** Set the current term position. | |||
* | ||||
* @param termpos The new term position to set. | ||||
*/ | ||||
void set_termpos(Xapian::termcount termpos); | void set_termpos(Xapian::termcount termpos); | |||
/// Return a string describing this object. | /// Return a string describing this object. | |||
std::string get_description() const; | std::string get_description() const; | |||
}; | }; | |||
} | } | |||
#endif // XAPIAN_INCLUDED_TERMGENERATOR_H | #endif // XAPIAN_INCLUDED_TERMGENERATOR_H | |||
End of changes. 9 change blocks. | ||||
5 lines changed or deleted | 28 lines changed or added | |||
types.h | types.h | |||
---|---|---|---|---|
skipping to change at line 90 | skipping to change at line 90 | |||
/** A timeout value in milliseconds. | /** A timeout value in milliseconds. | |||
* | * | |||
* There are 1000 milliseconds in a second, so for example, to set a | * There are 1000 milliseconds in a second, so for example, to set a | |||
* timeout of 5 seconds use 5000. | * timeout of 5 seconds use 5000. | |||
*/ | */ | |||
typedef unsigned timeout; | typedef unsigned timeout; | |||
/** The number for a value slot in a document. | /** The number for a value slot in a document. | |||
* | * | |||
* Any value slot number except Xapian::BAD_VALUENO is valid. | * 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. | ||||
*/ | */ | |||
typedef unsigned valueno; | typedef unsigned valueno; | |||
/** A signed difference between two value slot numbers. | /** A signed difference between two value slot numbers. | |||
* | * | |||
* This is used by the Xapian classes which are STL containers of values | * This is used by the Xapian classes which are STL containers of values | |||
* for "difference_type". | * for "difference_type". | |||
*/ | */ | |||
typedef int valueno_diff; /* FIXME: can overflow. */ | typedef int valueno_diff; /* FIXME: can overflow. */ | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||
unicode.h | unicode.h | |||
---|---|---|---|---|
/** @file unicode.h | /** @file unicode.h | |||
* @brief Unicode and UTF-8 related classes and functions. | * @brief Unicode and UTF-8 related classes and functions. | |||
*/ | */ | |||
/* Copyright (C) 2006,2007,2008,2009,2010 Olly Betts | /* Copyright (C) 2006,2007,2008,2009,2010,2011 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 162 | skipping to change at line 162 | |||
Utf8Iterator & operator++() { | Utf8Iterator & operator++() { | |||
if (seqlen == 0) calculate_sequence_length(); | if (seqlen == 0) calculate_sequence_length(); | |||
p += seqlen; | p += seqlen; | |||
if (p == end) p = NULL; | if (p == end) p = NULL; | |||
seqlen = 0; | seqlen = 0; | |||
return *this; | return *this; | |||
} | } | |||
/** Test two Utf8Iterators for equality. | /** Test two Utf8Iterators for equality. | |||
* | * | |||
* @param other The Utf8Iterator to compare this one with. | ||||
* @return true iff the iterators point to the same position. | * @return true iff the iterators point to the same position. | |||
*/ | */ | |||
bool operator==(const Utf8Iterator &other) const { return p == other.p; } | bool operator==(const Utf8Iterator &other) const { return p == other.p; } | |||
/** Test two Utf8Iterators for inequality. | /** Test two Utf8Iterators for inequality. | |||
* | * | |||
* @param other The Utf8Iterator to compare this one with. | ||||
* @return true iff the iterators do not point to the same position. | * @return true iff the iterators do not point to the same position. | |||
*/ | */ | |||
bool operator!=(const Utf8Iterator &other) const { return p != other.p; } | bool operator!=(const Utf8Iterator &other) const { return p != other.p; } | |||
/// We implement the semantics of an STL input_iterator. | /// We implement the semantics of an STL input_iterator. | |||
//@{ | //@{ | |||
typedef std::input_iterator_tag iterator_category; | typedef std::input_iterator_tag iterator_category; | |||
typedef unsigned value_type; | typedef unsigned value_type; | |||
typedef size_t difference_type; | typedef size_t difference_type; | |||
typedef const unsigned * pointer; | typedef const unsigned * pointer; | |||
skipping to change at line 253 | skipping to change at line 255 | |||
* with a suitable instruction). | * with a suitable instruction). | |||
*/ | */ | |||
return (info >= 0) ? (info >> 15) : (~(~info >> 15)); | return (info >= 0) ? (info >> 15) : (~(~info >> 15)); | |||
} | } | |||
} | } | |||
/** Convert a single non-ASCII Unicode character to UTF-8. | /** Convert a single non-ASCII Unicode character to UTF-8. | |||
* | * | |||
* This is intended mainly as a helper method for to_utf8(). | * This is intended mainly as a helper method for to_utf8(). | |||
* | * | |||
* The character @a ch (which must be > 128) is written to the buffer @a b | * @param ch The character (which must be > 128) to write to @a buf. | |||
uf | * @param buf The buffer to write the character to - it must have | |||
* and the length of the resultant UTF-8 character is returned. | * space for (at least) 4 bytes. | |||
* | * | |||
* NB buf must have space for (at least) 4 bytes. | * @return The length of the resultant UTF-8 character in bytes. | |||
*/ | */ | |||
XAPIAN_VISIBILITY_DEFAULT | XAPIAN_VISIBILITY_DEFAULT | |||
unsigned nonascii_to_utf8(unsigned ch, char * buf); | unsigned nonascii_to_utf8(unsigned ch, char * buf); | |||
/** Convert a single Unicode character to UTF-8. | /** Convert a single Unicode character to UTF-8. | |||
* | * | |||
* The character @a ch is written to the buffer @a buf and the length of t | * @param ch The character to write to @a buf. | |||
he | * @param buf The buffer to write the character to - it must have | |||
* resultant UTF-8 character is returned. | * space for (at least) 4 bytes. | |||
* | * | |||
* NB buf must have space for (at least) 4 bytes. | * @return The length of the resultant UTF-8 character in bytes. | |||
*/ | */ | |||
inline unsigned to_utf8(unsigned ch, char *buf) { | inline unsigned to_utf8(unsigned ch, char *buf) { | |||
if (ch < 128) { | if (ch < 128) { | |||
*buf = static_cast<unsigned char>(ch); | *buf = static_cast<unsigned char>(ch); | |||
return 1; | return 1; | |||
} | } | |||
return Xapian::Unicode::nonascii_to_utf8(ch, buf); | return Xapian::Unicode::nonascii_to_utf8(ch, buf); | |||
} | } | |||
/** Append the UTF-8 representation of a single Unicode character to a | /** Append the UTF-8 representation of a single Unicode character to a | |||
End of changes. 7 change blocks. | ||||
9 lines changed or deleted | 11 lines changed or added | |||
valueiterator.h | valueiterator.h | |||
---|---|---|---|---|
skipping to change at line 114 | skipping to change at line 114 | |||
* | * | |||
* If this iterator is over values in a particular slot, then this | * If this iterator is over values in a particular slot, then this | |||
* method advances the iterator to document id @a docid_or_slot, or th e | * method advances the iterator to document id @a docid_or_slot, or th e | |||
* first document id after it if there is no value in the slot we're | * first document id after it if there is no value in the slot we're | |||
* iterating over for document @a docid_or_slot. | * iterating over for document @a docid_or_slot. | |||
* | * | |||
* Note: The "two-faced" nature of this method is due to how C++ | * Note: The "two-faced" nature of this method is due to how C++ | |||
* overloading works. Xapian::docid and Xapian::valueno are both type defs | * overloading works. Xapian::docid and Xapian::valueno are both type defs | |||
* for the same unsigned integer type, so overloading can't distinguis h | * for the same unsigned integer type, so overloading can't distinguis h | |||
* them. | * them. | |||
* | ||||
* @param docid_or_slot The docid/slot to advance to. | ||||
*/ | */ | |||
void skip_to(Xapian::docid docid_or_slot); | void skip_to(Xapian::docid docid_or_slot); | |||
/** Check if the specified docid occurs. | /** Check if the specified docid occurs. | |||
* | * | |||
* The caller is required to ensure that the specified document id | * The caller is required to ensure that the specified document id | |||
* @a did actually exists in the database. | * @a did actually exists in the database. | |||
* | * | |||
* This method acts like skip_to() if that can be done at little extra | * This method acts like skip_to() if that can be done at little extra | |||
* cost, in which case it then returns true. This is how brass and | * cost, in which case it then returns true. This is how brass and | |||
skipping to change at line 138 | skipping to change at line 140 | |||
* is, it returns true. If it isn't, it returns false, and leaves the | * is, it returns true. If it isn't, it returns false, and leaves the | |||
* position unspecified (and hence the result of calling methods which | * position unspecified (and hence the result of calling methods which | |||
* depends on the current position, such as get_docid(), are also | * depends on the current position, such as get_docid(), are also | |||
* unspecified). In this state, next() will advance to the first matc hing | * unspecified). In this state, next() will advance to the first matc hing | |||
* position after document @a did, and skip_to() will act as it would if | * position after document @a did, and skip_to() will act as it would if | |||
* the position was the first matching position after document @a did. | * the position was the first matching position after document @a did. | |||
* | * | |||
* Currently the inmemory, flint, and remote backends behave in the | * Currently the inmemory, flint, and remote backends behave in the | |||
* latter way because they don't support streamed values and so skip_t o() | * latter way because they don't support streamed values and so skip_t o() | |||
* must check each document it skips over which is significantly slowe r. | * must check each document it skips over which is significantly slowe r. | |||
* | ||||
* @param docid The document id to check. | ||||
*/ | */ | |||
bool check(Xapian::docid docid); | bool check(Xapian::docid docid); | |||
/// Return a string describing this object. | /// Return a string describing this object. | |||
std::string get_description() const; | std::string get_description() const; | |||
/** @private @internal ValueIterator is what the C++ STL calls an | /** @private @internal ValueIterator is what the C++ STL calls an | |||
* input_iterator. | * input_iterator. | |||
* | * | |||
* The following typedefs allow std::iterator_traits<> to work so that | * The following typedefs allow std::iterator_traits<> to work so that | |||
End of changes. 2 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added | |||
valuesetmatchdecider.h | valuesetmatchdecider.h | |||
---|---|---|---|---|
/** \file valuesetmatchdecider.h | /** \file valuesetmatchdecider.h | |||
* \brief MatchDecider subclass for filtering results by value. | * \brief MatchDecider subclass for filtering results by value. | |||
*/ | */ | |||
/* Copyright 2008 Lemur Consulting Limited | /* Copyright 2008 Lemur Consulting Limited | |||
* Copyright 2008,2009 Olly Betts | * Copyright 2008,2009,2011 Olly Betts | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU General Public License for more details. | * GNU General Public License for more details. | |||
skipping to change at line 84 | skipping to change at line 84 | |||
/** Remove a value from the test set. | /** Remove a value from the test set. | |||
* | * | |||
* @param value The value to remove from the test set. | * @param value The value to remove from the test set. | |||
*/ | */ | |||
void remove_value(const std::string& value) | void remove_value(const std::string& value) | |||
{ | { | |||
testset.erase(value); | testset.erase(value); | |||
} | } | |||
/** Decide whether we want this document to be in the MSet. | /** Decide whether we want a particular document to be in the MSet. | |||
* | * | |||
* Return true if the document is acceptable, or false if the document | * @param doc The document to test. | |||
* should be excluded from the MSet. | * @return true if the document is acceptable, or false | |||
if the | ||||
* document should be excluded from the MSet. | ||||
*/ | */ | |||
bool operator()(const Xapian::Document& doc) const; | bool operator()(const Xapian::Document& doc) const; | |||
}; | }; | |||
} | } | |||
#endif /* XAPIAN_INCLUDED_VALUESETMATCHDECIDER_H */ | #endif /* XAPIAN_INCLUDED_VALUESETMATCHDECIDER_H */ | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added | |||
version.h | version.h | |||
---|---|---|---|---|
skipping to change at line 31 | skipping to change at line 31 | |||
#define XAPIAN_INCLUDED_VERSION_H | #define XAPIAN_INCLUDED_VERSION_H | |||
#ifdef __GNUC__ | #ifdef __GNUC__ | |||
#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0) | #if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ == 0) | |||
#error Xapian no longer supports GCC < 3.1 | #error Xapian no longer supports GCC < 3.1 | |||
#else | #else | |||
#if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION != 1002 | #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION != 1002 | |||
#error The C++ ABI version of compiler you are using does not match | #error The C++ ABI version of compiler you are using does not match | |||
#error that of the compiler used to build the library. The versions | #error that of the compiler used to build the library. The versions | |||
#error must match or your program will not work correctly. | #error must match or your program will not work correctly. | |||
#error The Xapian library was built with g++ 4.5.0 | #error The Xapian library was built with g++ 4.6.1 | |||
#endif | #endif | |||
#ifdef _GLIBCXX_DEBUG | #ifdef _GLIBCXX_DEBUG | |||
#error You are compiling with _GLIBCXX_DEBUG defined, but the library | #error You are compiling with _GLIBCXX_DEBUG defined, but the library | |||
#error was not compiled with this flag. The settings must match or your | #error was not compiled with this flag. The settings must match or your | |||
#error program will not work correctly. | #error program will not work correctly. | |||
#endif | #endif | |||
#endif | #endif | |||
#endif | #endif | |||
/// The library was compiled with GCC's -fvisibility=hidden option. | /// The library was compiled with GCC's -fvisibility=hidden option. | |||
#define XAPIAN_ENABLE_VISIBILITY | #define XAPIAN_ENABLE_VISIBILITY | |||
/// The version of Xapian as a C string literal. | /// The version of Xapian as a C string literal. | |||
#define XAPIAN_VERSION "1.2.7" | #define XAPIAN_VERSION "1.2.8" | |||
/** The major component of the Xapian version. | /** The major component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 1 | * E.g. for Xapian 1.0.14 this would be: 1 | |||
*/ | */ | |||
#define XAPIAN_MAJOR_VERSION 1 | #define XAPIAN_MAJOR_VERSION 1 | |||
/** The minor component of the Xapian version. | /** The minor component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 0 | * E.g. for Xapian 1.0.14 this would be: 0 | |||
*/ | */ | |||
#define XAPIAN_MINOR_VERSION 2 | #define XAPIAN_MINOR_VERSION 2 | |||
/** The revision component of the Xapian version. | /** The revision component of the Xapian version. | |||
* E.g. for Xapian 1.0.14 this would be: 14 | * E.g. for Xapian 1.0.14 this would be: 14 | |||
*/ | */ | |||
#define XAPIAN_REVISION 7 | #define XAPIAN_REVISION 8 | |||
/// XAPIAN_HAS_BRASS_BACKEND Defined if the brass backend is enabled. | /// XAPIAN_HAS_BRASS_BACKEND Defined if the brass backend is enabled. | |||
#define XAPIAN_HAS_BRASS_BACKEND 1 | #define XAPIAN_HAS_BRASS_BACKEND 1 | |||
/// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled. | /// XAPIAN_HAS_CHERT_BACKEND Defined if the chert backend is enabled. | |||
#define XAPIAN_HAS_CHERT_BACKEND 1 | #define XAPIAN_HAS_CHERT_BACKEND 1 | |||
/// XAPIAN_HAS_FLINT_BACKEND Defined if the flint backend is enabled. | /// XAPIAN_HAS_FLINT_BACKEND Defined if the flint backend is enabled. | |||
#define XAPIAN_HAS_FLINT_BACKEND 1 | #define XAPIAN_HAS_FLINT_BACKEND 1 | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added | |||
weight.h | weight.h | |||
---|---|---|---|---|
/** @file weight.h | /** @file weight.h | |||
* @brief Weighting scheme API. | * @brief Weighting scheme API. | |||
*/ | */ | |||
/* Copyright (C) 2007,2008,2009,2010 Olly Betts | /* Copyright (C) 2007,2008,2009,2010,2011 Olly Betts | |||
* Copyright (C) 2009 Lemur Consulting Ltd | * Copyright (C) 2009 Lemur Consulting Ltd | |||
* | * | |||
* This program is free software; you can redistribute it and/or | * This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | * modify it under the terms of the GNU General Public License as | |||
* published by the Free Software Foundation; either version 2 of the | * published by the Free Software Foundation; either version 2 of the | |||
* License, or (at your option) any later version. | * License, or (at your option) any later version. | |||
* | * | |||
* This program is distributed in the hope that it will be useful, | * This program is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
skipping to change at line 159 | skipping to change at line 159 | |||
/** Unserialise parameters. | /** Unserialise parameters. | |||
* | * | |||
* This method unserialises parameters serialised by the @a serialise( ) | * This method unserialises parameters serialised by the @a serialise( ) | |||
* method and allocates and returns a new object initialised with them . | * method and allocates and returns a new object initialised with them . | |||
* | * | |||
* If you don't want to support the remote backend, you can use the | * If you don't want to support the remote backend, you can use the | |||
* default implementation which simply throws Xapian::UnimplementedErr or. | * default implementation which simply throws Xapian::UnimplementedErr or. | |||
* | * | |||
* Note that the returned object will be deallocated by Xapian after u se | * Note that the returned object will be deallocated by Xapian after u se | |||
* with "delete". It must therefore have been allocated with "new". | * with "delete". It must therefore have been allocated with "new". | |||
* | ||||
* @param s A string containing the serialised parameters. | ||||
*/ | */ | |||
virtual Weight * unserialise(const std::string & s) const; | virtual Weight * unserialise(const std::string & s) const; | |||
/** Calculate the weight contribution for this object's term to a docum ent. | /** Calculate the weight contribution for this object's term to a docum ent. | |||
* | * | |||
* The parameters give information about the document which may be use d | * The parameters give information about the document which may be use d | |||
* in the calculations: | * in the calculations: | |||
* | * | |||
* @param wdf The within document frequency of the term in the docu ment. | * @param wdf The within document frequency of the term in the docu ment. | |||
* @param doclen The document's length (unnormalised). | * @param doclen The document's length (unnormalised). | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 3 lines changed or added | |||