|
xapian-core
2.0.0
|
Virtual base class for Database internals. More...
#include <databaseinternal.h>
Inheritance diagram for Xapian::Database::Internal:
Collaboration diagram for Xapian::Database::Internal:Public Types | |
| typedef Xapian::doccount | size_type |
Public Member Functions | |
| virtual | ~Internal () |
| We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More... | |
| virtual size_type | size () const |
| virtual void | keep_alive () |
| virtual void | readahead_for_query (const Query &query) const |
| virtual doccount | get_doccount () const =0 |
| virtual docid | get_lastdocid () const =0 |
| Return the last used document id of this (sub) database. More... | |
| virtual totallength | get_total_length () const =0 |
| Return the total length of all documents in this database. More... | |
| virtual termcount | get_doclength (docid did) const =0 |
| virtual termcount | get_unique_terms (docid did) const =0 |
| Get the number of unique terms in document. More... | |
| virtual termcount | get_wdfdocmax (docid did) const =0 |
| Get the max wdf in document. More... | |
| virtual void | get_freqs (std::string_view term, doccount *termfreq_ptr, termcount *collfreq_ptr) const =0 |
| Returns frequencies for a term. More... | |
| virtual doccount | get_value_freq (valueno slot) const =0 |
| Return the frequency of a given value slot. More... | |
| virtual std::string | get_value_lower_bound (valueno slot) const =0 |
| Get a lower bound on the values stored in the given value slot. More... | |
| virtual std::string | get_value_upper_bound (valueno slot) const =0 |
| Get an upper bound on the values stored in the given value slot. More... | |
| virtual termcount | get_doclength_lower_bound () const =0 |
| Get a lower bound on the length of a document in this DB. More... | |
| virtual termcount | get_doclength_upper_bound () const =0 |
| Get an upper bound on the length of a document in this DB. More... | |
| virtual termcount | get_wdf_upper_bound (std::string_view term) const =0 |
| Get an upper bound on the wdf of term term. More... | |
| virtual termcount | get_unique_terms_lower_bound () const |
| Get a lower bound on the unique terms size of a document in this DB. More... | |
| virtual termcount | get_unique_terms_upper_bound () const |
| Get an upper bound on the unique terms size of a document in this DB. More... | |
| virtual bool | term_exists (std::string_view term) const =0 |
| virtual bool | has_positions () const =0 |
| Check whether this database contains any positional information. More... | |
| virtual PostList * | open_post_list (std::string_view term) const =0 |
| Return a PostList suitable for use in a PostingIterator. More... | |
| virtual LeafPostList * | open_leaf_post_list (std::string_view term, bool need_read_pos) const =0 |
| Create a LeafPostList for use during a match. More... | |
| virtual ValueList * | open_value_list (valueno slot) const |
| Open a value stream. More... | |
| virtual TermList * | open_term_list (docid did) const =0 |
| virtual TermList * | open_term_list_direct (docid did) const =0 |
| Like open_term_list() but without MultiTermList wrapper. More... | |
| virtual TermList * | open_allterms (std::string_view prefix) const =0 |
| virtual PositionList * | open_position_list (docid did, std::string_view term) const =0 |
| virtual Document::Internal * | open_document (docid did, bool lazy) const =0 |
| Open a handle on a document. More... | |
| virtual TermList * | open_spelling_termlist (std::string_view word) const |
| Create a termlist tree from trigrams of word. More... | |
| virtual TermList * | open_spelling_wordlist () const |
| Return a termlist which returns the words which are spelling correction targets. More... | |
| virtual doccount | get_spelling_frequency (std::string_view word) const |
| Return the number of times word was added as a spelling. More... | |
| virtual void | add_spelling (std::string_view word, termcount freqinc) const |
| Add a word to the spelling dictionary. More... | |
| virtual termcount | remove_spelling (std::string_view word, termcount freqdec) const |
| Remove a word from the spelling dictionary. More... | |
| virtual TermList * | open_synonym_termlist (std::string_view term) const |
| Open a termlist returning synonyms for a term. More... | |
| virtual TermList * | open_synonym_keylist (std::string_view prefix) const |
| Open a termlist returning each term which has synonyms. More... | |
| virtual void | add_synonym (std::string_view term, std::string_view synonym) const |
| Add a synonym for a term. More... | |
| virtual void | remove_synonym (std::string_view term, std::string_view synonym) const |
| Remove a synonym for a term. More... | |
| virtual void | clear_synonyms (std::string_view term) const |
| Clear all synonyms for a term. More... | |
| virtual std::string | get_metadata (std::string_view key) const |
| Get the metadata associated with a given key. More... | |
| virtual TermList * | open_metadata_keylist (std::string_view prefix) const |
| Open a termlist returning each metadata key. More... | |
| virtual void | set_metadata (std::string_view key, std::string_view value) |
| Set the metadata associated with a given key. More... | |
| virtual bool | reopen () |
| Reopen the database to the latest available revision. More... | |
| virtual void | close ()=0 |
| Close the database. More... | |
| virtual void | commit () |
| Commit pending modifications to the database. More... | |
| virtual void | cancel () |
| Cancel pending modifications to the database. More... | |
| virtual void | begin_transaction (bool flushed) |
| Begin transaction. More... | |
| virtual void | end_transaction (bool do_commit) |
| End transaction. More... | |
| virtual docid | add_document (const Document &document) |
| virtual void | delete_document (docid did) |
| virtual void | delete_document (std::string_view unique_term) |
| Delete any documents indexed by a term from the database. More... | |
| virtual void | replace_document (docid did, const Document &document) |
| virtual docid | replace_document (std::string_view unique_term, const Document &document) |
| Replace any documents matching a term. More... | |
| virtual void | request_document (docid did) const |
| Request a document. More... | |
| virtual void | write_changesets_to_fd (int fd, std::string_view start_revision, bool need_whole_db, ReplicationInfo *info) |
| Write a set of changesets to a file descriptor. More... | |
| virtual Xapian::rev | get_revision () const |
| Get revision number of database (if meaningful). More... | |
| virtual std::string | get_uuid () const |
| Get a UUID for the database. More... | |
| virtual void | invalidate_doc_object (Document::Internal *obj) const |
| Notify the database that document is no longer valid. More... | |
| virtual int | get_backend_info (std::string *path) const =0 |
| Get backend information about this database. More... | |
| virtual void | get_used_docid_range (docid &first, docid &last) const |
| Find lowest and highest docids actually in use. More... | |
| virtual bool | locked () const |
| Return true if the database is open for writing. More... | |
| virtual Internal * | update_lock (int flags) |
| Lock a read-only database for writing or unlock a writable database. More... | |
| virtual std::string | reconstruct_text (Xapian::docid did, size_t length, std::string_view prefix, Xapian::termpos start_pos, Xapian::termpos end_pos) const |
| virtual std::string | get_description () const =0 |
| Return a string describing this object. More... | |
Public Member Functions inherited from Xapian::Internal::intrusive_base | |
| intrusive_base () | |
| Construct with no references. More... | |
Protected Types | |
| enum | transaction_state { TRANSACTION_READONLY = -2 , TRANSACTION_UNIMPLEMENTED = -1 , TRANSACTION_NONE = 0 , TRANSACTION_UNFLUSHED = 1 , TRANSACTION_FLUSHED = 2 } |
| Transaction state enum. More... | |
Protected Member Functions | |
| Internal (transaction_state transaction_support) | |
| Only constructable as a base class for derived classes. More... | |
| bool | is_read_only () const |
| Test if this shard is read-only. More... | |
| bool | transaction_active () const |
| Test if a transaction is currently active. More... | |
| void | dtor_called () |
| Helper to process uncommitted changes when a writable db is destroyed. More... | |
Protected Attributes | |
| transaction_state | state |
| Current transaction state. More... | |
Private Member Functions | |
| Internal & | operator= (const Internal &)=delete |
| Don't allow assignment. More... | |
| Internal (const Internal &)=delete | |
| Don't allow copying. More... | |
| void | dtor_called_ () |
| The "action required" helper for the dtor_called() helper. More... | |
Friends | |
| class | Database |
Additional Inherited Members | |
Public Attributes inherited from Xapian::Internal::intrusive_base | |
| unsigned | _refs |
| Reference count. More... | |
Virtual base class for Database internals.
Definition at line 58 of file databaseinternal.h.
Definition at line 126 of file databaseinternal.h.
|
protected |
Transaction state enum.
| Enumerator | |
|---|---|
| TRANSACTION_READONLY | |
| TRANSACTION_UNIMPLEMENTED | |
| TRANSACTION_NONE | |
| TRANSACTION_UNFLUSHED | |
| TRANSACTION_FLUSHED | |
Definition at line 72 of file databaseinternal.h.
|
privatedelete |
Don't allow copying.
|
inlineprotected |
Only constructable as a base class for derived classes.
| transaction_support | One of:
|
Definition at line 87 of file databaseinternal.h.
|
inlinevirtual |
We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor.
Definition at line 124 of file databaseinternal.h.
|
virtual |
Reimplemented in InMemoryDatabase, GlassWritableDatabase, RemoteDatabase, MultiDatabase, and EmptyDatabase.
Definition at line 173 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Add a word to the spelling dictionary.
If the word is already present, its frequency is increased.
| word | The word to add. |
| freqinc | How much to increase its frequency by. |
Reimplemented in RemoteDatabase, MultiDatabase, HoneyDatabase, GlassWritableDatabase, and EmptyDatabase.
Definition at line 307 of file databaseinternal.cc.
|
virtual |
Add a synonym for a term.
If synonym is already a synonym for term, then no action is taken.
Reimplemented in RemoteDatabase, GlassWritableDatabase, MultiDatabase, HoneyDatabase, and EmptyDatabase.
Definition at line 337 of file databaseinternal.cc.
|
virtual |
Begin transaction.
Reimplemented in MultiDatabase, and EmptyDatabase.
Definition at line 117 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Cancel pending modifications to the database.
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 109 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Clear all synonyms for a term.
If term has no synonyms, no action is taken.
Reimplemented in RemoteDatabase, GlassWritableDatabase, MultiDatabase, HoneyDatabase, and EmptyDatabase.
Definition at line 349 of file databaseinternal.cc.
|
pure virtual |
Close the database.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
|
virtual |
Commit pending modifications to the database.
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, GlassWritableDatabase, and EmptyDatabase.
Definition at line 101 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, GlassWritableDatabase, and EmptyDatabase.
Definition at line 182 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Delete any documents indexed by a term from the database.
Reimplemented in RemoteDatabase, MultiDatabase, and EmptyDatabase.
Definition at line 191 of file databaseinternal.cc.
References invalid_operation().
|
inlineprotected |
Helper to process uncommitted changes when a writable db is destroyed.
The destructor of a derived writable database class needs to call this method - we can't call it from our own destructor because we need to be able to call methods in the derived class, but that's no longer valid by the time our destructor runs, as that happens after the destructor of the derived class has run.
If a transaction is active, it is cancelled. Otherwise we attempt to commit uncommitted changes, but because it is not safe to throw exceptions from destructors, this method will catch and discard any exceptions.
Definition at line 114 of file databaseinternal.h.
References dtor_called_(), and state.
Referenced by GlassWritableDatabase::~GlassWritableDatabase(), and InMemoryDatabase::~InMemoryDatabase().
|
private |
The "action required" helper for the dtor_called() helper.
Definition at line 83 of file databaseinternal.cc.
References AssertEq.
Referenced by dtor_called().
|
virtual |
End transaction.
| do_commit | If true, commits the transaction; if false, cancels the transaction. |
Reimplemented in MultiDatabase.
Definition at line 141 of file databaseinternal.cc.
References invalid_operation().
Referenced by RemoteDatabase::do_close().
|
pure virtual |
Get backend information about this database.
| path | If non-NULL, and set the pointed to string to the file path of this database (or to some string describing the database in a backend-specified format if "path" isn't a concept which makes sense). |
Implemented in GlassDatabase, RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, and EmptyDatabase.
Referenced by backend_mismatch().
|
pure virtual |
Return a string describing this object.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
|
pure virtual |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and LocalSubMatch::resolve().
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by PostListTree::get_doc_stats(), and PostListTree::get_doclength().
|
pure virtual |
Get a lower bound on the length of a document in this DB.
This bound does not include any zero-length documents.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Xapian::Weight::init_().
|
pure virtual |
Get an upper bound on the length of a document in this DB.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Xapian::Weight::init_().
|
pure virtual |
Returns frequencies for a term.
| term | The term to get frequencies for |
| termfreq_ptr | Point to return number of docs indexed by term (or NULL not to return) |
| collfreq_ptr | Point to return number of occurrences of term in the database (or NULL not to return) |
Implemented in MultiDatabase, EmptyDatabase, RemoteDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, and GlassDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), MultiTermList::get_termfreq(), and LocalSubMatch::register_lazy_postlist_for_stats().
|
pure virtual |
Return the last used document id of this (sub) database.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
|
virtual |
Get the metadata associated with a given key.
See Database::get_metadata() for more information.
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 355 of file databaseinternal.cc.
|
virtual |
Get revision number of database (if meaningful).
Reimplemented in MultiDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 396 of file databaseinternal.cc.
|
virtual |
Return the number of times word was added as a spelling.
Reimplemented in MultiDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 298 of file databaseinternal.cc.
|
pure virtual |
Return the total length of all documents in this database.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats().
Get the number of unique terms in document.
| did | The document id of the document to return this value for. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by PostListTree::get_doc_stats().
|
virtual |
Get a lower bound on the unique terms size of a document in this DB.
Reimplemented in MultiDatabase, HoneyDatabase, and GlassDatabase.
Definition at line 69 of file databaseinternal.cc.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Xapian::Weight::init_().
|
virtual |
Get an upper bound on the unique terms size of a document in this DB.
Reimplemented in MultiDatabase, and HoneyDatabase.
Definition at line 75 of file databaseinternal.cc.
Referenced by Xapian::Weight::Internal::accumulate_stats(), and Xapian::Weight::init_().
|
virtual |
Find lowest and highest docids actually in use.
Used during local matching and compaction, so only needs to be implemented by backends which support one or both of these.
For example, EmptyDatabase, MultiDatabase and RemoteDatabase don't need to implement this (empty shards are skipped early by the matcher; sharded databases are handled explicitly by the matcher rather than via the "multi" backend; matching for remote shards runs as a local match on the remote).
Reimplemented in InMemoryDatabase, HoneyDatabase, and GlassDatabase.
Definition at line 414 of file databaseinternal.cc.
Referenced by LocalSubMatch::resolve().
|
virtual |
Get a UUID for the database.
The UUID will persist for the lifetime of the database.
Replicas (eg, made with the replication protocol, or by copying all the database files) will have the same UUID. However, copies (made with copydatabase, or xapian-compact) will have different UUIDs.
If the backend does not support UUIDs the empty string is returned.
Reimplemented in RemoteDatabase, MultiDatabase, HoneyDatabase, and GlassDatabase.
Definition at line 402 of file databaseinternal.cc.
Return the frequency of a given value slot.
This is the number of documents which have a (non-empty) value stored in the slot.
| slot | The value slot to examine. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
pure virtual |
Get a lower bound on the values stored in the given value slot.
If there are no values stored in the given value slot, this will return an empty string.
| slot | The value slot to examine. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
pure virtual |
Get an upper bound on the values stored in the given value slot.
If there are no values stored in the given value slot, this will return an empty string.
| slot | The value slot to examine. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
pure virtual |
Get an upper bound on the wdf of term term.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Get the max wdf in document.
| did | The document id of the document to return this value for. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Referenced by PostListTree::get_doc_stats().
|
pure virtual |
Check whether this database contains any positional information.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Document::Internal::clear_terms(), and Xapian::Internal::QueryWindowed::postlist_windowed().
|
virtual |
Notify the database that document is no longer valid.
This is used to invalidate references to a document kept by a database for doing lazy updates. If we moved to using a weak_ptr instead we wouldn't need a special method for this, but it would involve a fair bit of reorganising of other parts of the code.
Reimplemented in MultiDatabase, GlassWritableDatabase, and EmptyDatabase.
Definition at line 408 of file databaseinternal.cc.
|
inlineprotected |
Test if this shard is read-only.
Definition at line 94 of file databaseinternal.h.
References state, and TRANSACTION_READONLY.
Referenced by Xapian::Database::add_database_(), and RemoteDatabase::do_close().
|
virtual |
Reimplemented in RemoteDatabase, and MultiDatabase.
Definition at line 58 of file databaseinternal.cc.
|
virtual |
Return true if the database is open for writing.
If this is a WritableDatabase, always returns true.
For a Database, test if there's a writer holding the lock (or if we can't test for a lock without taking it on the current platform, throw Xapian::UnimplementedError).
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, and GlassDatabase.
Definition at line 421 of file databaseinternal.cc.
|
pure virtual |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Database::allterms_begin().
|
pure virtual |
Open a handle on a document.
The returned handle provides access to document data and document values.
| did | The document id to open. |
| lazy | If true, there's no need to check that this document actually exists (only a hint - the backend may still check). Used to avoid unnecessary work when we already know that the requested document exists. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Database::get_document().
|
pure virtual |
Create a LeafPostList for use during a match.
| term | The term to open a postlist for, or the empty string to create an all-docs postlist. |
| need_read_pos | Does the postlist need to support read_position_list()? Note that open_position_list() may still be called even if need_read_pos is false. |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
|
virtual |
Open a termlist returning each metadata key.
Only metadata keys which are associated with a non-empty value will be returned.
| prefix | If non-empty, only keys with this prefix are returned. |
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 361 of file databaseinternal.cc.
Referenced by Xapian::Database::metadata_keys_begin().
|
pure virtual |
Implemented in RemoteDatabase, InMemoryDatabase, MultiDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Database::positionlist_begin().
|
pure virtual |
Return a PostList suitable for use in a PostingIterator.
Implemented in InMemoryDatabase, GlassDatabase, RemoteDatabase, MultiDatabase, HoneyDatabase, GlassWritableDatabase, and EmptyDatabase.
Referenced by Xapian::Internal::QueryValueRange::postlist(), Xapian::Internal::QueryValueLE::postlist(), and Xapian::Internal::QueryValueGE::postlist().
|
virtual |
Create a termlist tree from trigrams of word.
You can assume word.size() > 1.
If there are no trigrams, returns NULL.
Reimplemented in MultiDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 280 of file databaseinternal.cc.
Referenced by Xapian::Database::get_spelling_suggestion().
|
virtual |
Return a termlist which returns the words which are spelling correction targets.
If there are no spelling correction targets, returns NULL.
Reimplemented in MultiDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 289 of file databaseinternal.cc.
Referenced by Xapian::Database::spellings_begin().
|
virtual |
Open a termlist returning each term which has synonyms.
| prefix | If non-empty, only terms with this prefix are returned. |
Reimplemented in RemoteDatabase, MultiDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 328 of file databaseinternal.cc.
Referenced by Xapian::Database::synonym_keys_begin().
|
virtual |
Open a termlist returning synonyms for a term.
If term has no synonyms, returns NULL.
Reimplemented in RemoteDatabase, MultiDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 319 of file databaseinternal.cc.
Referenced by Xapian::Database::synonyms_begin().
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
Referenced by Xapian::Weight::Internal::accumulate_stats(), Xapian::Database::termlist_begin(), and Xapian::Document::Internal::termlist_count().
Like open_term_list() but without MultiTermList wrapper.
MultiDatabase::open_term_list() wraps the returns TermList in a MultiTermList, but we don't want that for query expansion.
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassDatabase, and EmptyDatabase.
|
virtual |
Open a value stream.
This returns the value in a particular slot for each document.
| slot | The value slot. |
Reimplemented in MultiDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 274 of file databaseinternal.cc.
Referenced by Xapian::Database::valuestream_begin().
Don't allow assignment.
|
virtual |
Reimplemented in HoneyDatabase, and GlassDatabase.
Definition at line 64 of file databaseinternal.cc.
|
virtual |
Reimplemented in RemoteDatabase, and MultiDatabase.
Definition at line 489 of file databaseinternal.cc.
References Heap::make(), Heap::pop(), pos, Xapian::reconstruct_open_poslists(), Heap::replace(), UNSIGNED_OVERFLOW_OK, and usual.
|
virtual |
Remove a word from the spelling dictionary.
The word's frequency is decreased, and if would become zero or less then the word is removed completely.
| word | The word to remove. |
| freqdec | How much to decrease its frequency by. |
Reimplemented in RemoteDatabase, MultiDatabase, HoneyDatabase, GlassWritableDatabase, and EmptyDatabase.
Definition at line 313 of file databaseinternal.cc.
|
virtual |
Remove a synonym for a term.
If synonym isn't a synonym for term, then no action is taken.
Reimplemented in RemoteDatabase, GlassWritableDatabase, MultiDatabase, HoneyDatabase, and EmptyDatabase.
Definition at line 343 of file databaseinternal.cc.
|
virtual |
Reopen the database to the latest available revision.
Database backends which don't support simultaneous update and reading probably don't need to do anything here.
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, and GlassDatabase.
Definition at line 375 of file databaseinternal.cc.
|
virtual |
Reimplemented in InMemoryDatabase, GlassWritableDatabase, RemoteDatabase, MultiDatabase, and EmptyDatabase.
Definition at line 226 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Replace any documents matching a term.
Reimplemented in RemoteDatabase, MultiDatabase, and EmptyDatabase.
Definition at line 235 of file databaseinternal.cc.
References invalid_operation().
|
virtual |
Request a document.
This tells the database that we're going to want a particular document soon. It's just a hint which the backend may ignore, but for glass it issues a preread hint on the file with the document data in, and for the remote backend it might cause the document to be fetched asynchronously (this isn't currently implemented though).
It can be called for multiple documents in turn, and a common usage pattern would be to iterate over an MSet and request the documents, then iterate over it again to actually get and display them.
The default implementation is a no-op.
Reimplemented in GlassDatabase, RemoteDatabase, MultiDatabase, and HoneyDatabase.
Definition at line 384 of file databaseinternal.cc.
|
virtual |
Set the metadata associated with a given key.
See WritableDatabase::set_metadata() for more information.
Reimplemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, and EmptyDatabase.
Definition at line 369 of file databaseinternal.cc.
|
virtual |
Reimplemented in MultiDatabase, and EmptyDatabase.
Definition at line 52 of file databaseinternal.cc.
Referenced by Xapian::Database::add_database_().
|
pure virtual |
Implemented in RemoteDatabase, MultiDatabase, InMemoryDatabase, HoneyDatabase, GlassWritableDatabase, GlassDatabase, and EmptyDatabase.
|
inlineprotected |
Test if a transaction is currently active.
Definition at line 99 of file databaseinternal.h.
References state.
Referenced by GlassWritableDatabase::check_flush_threshold(), GlassWritableDatabase::close(), GlassWritableDatabase::commit(), and RemoteDatabase::do_close().
|
virtual |
Lock a read-only database for writing or unlock a writable database.
This is the internal method behind Database::lock() and Database::unlock().
In the unlocking case, the writable database is closed. In the locking case, the read-only database is left open.
| flags | Xapian::DB_READONLY_ to unlock, otherwise the flags to use when opening from writing. |
Reimplemented in InMemoryDatabase, GlassWritableDatabase, and GlassDatabase.
Definition at line 427 of file databaseinternal.cc.
Referenced by Xapian::Database::lock(), and Xapian::Database::unlock().
|
virtual |
Write a set of changesets to a file descriptor.
This call may reopen the database, leaving it pointing to a more recent version of the database.
Reimplemented in MultiDatabase, GlassDatabase, and EmptyDatabase.
Definition at line 389 of file databaseinternal.cc.
|
friend |
Definition at line 59 of file databaseinternal.h.
|
protected |
Current transaction state.
Definition at line 91 of file databaseinternal.h.
Referenced by dtor_called(), is_read_only(), and transaction_active().