xapian-core  2.0.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
HoneyDatabase Class Reference

Database using honey backend. More...

#include <honey_database.h>

+ Inheritance diagram for HoneyDatabase:
+ Collaboration diagram for HoneyDatabase:

Public Member Functions

 HoneyDatabase (std::string_view path_, int flags=Xapian::DB_READONLY_)
 
 HoneyDatabase (int fd, int flags=Xapian::DB_READONLY_)
 
 ~HoneyDatabase ()
 
void readahead_for_query (const Xapian::Query &query) const
 
Xapian::doccount get_doccount () const
 
Xapian::docid get_lastdocid () const
 Return the last used document id of this (sub) database. More...
 
Xapian::totallength get_total_length () const
 Return the total length of all documents in this database. More...
 
Xapian::termcount get_doclength (Xapian::docid did) const
 
Xapian::termcount get_unique_terms (Xapian::docid did) const
 Get the number of unique terms in document. More...
 
Xapian::termcount get_wdfdocmax (Xapian::docid did) const
 Get the max wdf in document. More...
 
void get_freqs (std::string_view term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const
 Returns frequencies for a term. More...
 
Xapian::doccount get_value_freq (Xapian::valueno slot) const
 Return the frequency of a given value slot. More...
 
std::string get_value_lower_bound (Xapian::valueno slot) const
 Get a lower bound on the values stored in the given value slot. More...
 
std::string get_value_upper_bound (Xapian::valueno slot) const
 Get an upper bound on the values stored in the given value slot. More...
 
Xapian::termcount get_doclength_lower_bound () const
 Get a lower bound on the length of a document in this DB. More...
 
Xapian::termcount get_doclength_upper_bound () const
 Get an upper bound on the length of a document in this DB. More...
 
Xapian::termcount get_wdf_upper_bound (std::string_view term) const
 Get an upper bound on the wdf of term term. More...
 
Xapian::termcount get_unique_terms_lower_bound () const
 Get a lower bound on the unique terms size of a document in this DB. More...
 
Xapian::termcount get_unique_terms_upper_bound () const
 Get an upper bound on the unique terms size of a document in this DB. More...
 
bool term_exists (std::string_view term) const
 
bool has_positions () const
 Check whether this database contains any positional information. More...
 
PostListopen_post_list (std::string_view term) const
 Return a PostList suitable for use in a PostingIterator. More...
 
LeafPostListopen_leaf_post_list (std::string_view term, bool need_read_pos) const
 Create a LeafPostList for use during a match. More...
 
ValueListopen_value_list (Xapian::valueno slot) const
 Open a value stream. More...
 
TermListopen_term_list (Xapian::docid did) const
 
TermListopen_term_list_direct (Xapian::docid did) const
 Like open_term_list() but without MultiTermList wrapper. More...
 
TermListopen_allterms (std::string_view prefix) const
 
PositionListopen_position_list (Xapian::docid did, std::string_view term) const
 
Xapian::Document::Internalopen_document (Xapian::docid did, bool lazy) const
 Open a handle on a document. More...
 
TermListopen_spelling_termlist (std::string_view word) const
 Create a termlist tree from trigrams of word. More...
 
TermListopen_spelling_wordlist () const
 Return a termlist which returns the words which are spelling correction targets. More...
 
Xapian::doccount get_spelling_frequency (std::string_view word) const
 Return the number of times word was added as a spelling. More...
 
void add_spelling (std::string_view word, Xapian::termcount freqinc) const
 Add a word to the spelling dictionary. More...
 
Xapian::termcount remove_spelling (std::string_view word, Xapian::termcount freqdec) const
 Remove a word from the spelling dictionary. More...
 
TermListopen_synonym_termlist (std::string_view term) const
 Open a termlist returning synonyms for a term. More...
 
TermListopen_synonym_keylist (std::string_view prefix) const
 Open a termlist returning each term which has synonyms. More...
 
void add_synonym (std::string_view term, std::string_view synonym) const
 Add a synonym for a term. More...
 
void remove_synonym (std::string_view term, std::string_view synonym) const
 Remove a synonym for a term. More...
 
void clear_synonyms (std::string_view term) const
 Clear all synonyms for a term. More...
 
std::string get_metadata (std::string_view key) const
 Get the metadata associated with a given key. More...
 
TermListopen_metadata_keylist (std::string_view prefix) const
 Open a termlist returning each metadata key. More...
 
void set_metadata (std::string_view key, std::string_view value)
 Set the metadata associated with a given key. More...
 
bool reopen ()
 Reopen the database to the latest available revision. More...
 
void close ()
 Close the database. More...
 
void request_document (Xapian::docid did) const
 Request a document. More...
 
Xapian::rev get_revision () const
 Get the current revision of the database. More...
 
std::string get_uuid () const
 Get a UUID for the database. More...
 
int get_backend_info (std::string *path) const
 Get backend information about this database. More...
 
void get_used_docid_range (Xapian::docid &first, Xapian::docid &last) const
 Find lowest and highest docids actually in use. More...
 
bool has_uncommitted_changes () const
 
bool single_file () const
 
HoneyCursorget_postlist_cursor () const
 
std::string get_description () const
 Return a string describing this object. More...
 
- Public Member Functions inherited from Xapian::Database::Internal
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 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 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 void invalidate_doc_object (Document::Internal *obj) const
 Notify the database that document is no longer valid. More...
 
virtual bool locked () const
 Return true if the database is open for writing. More...
 
virtual Internalupdate_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
 
- Public Member Functions inherited from Xapian::Internal::intrusive_base
 intrusive_base ()
 Construct with no references. More...
 

Static Public Member Functions

static void compact (Xapian::Compactor *compactor, const char *destdir, int fd, int source_backend, const std::vector< const Xapian::Database::Internal * > &sources, const std::vector< Xapian::docid > &offset, Xapian::Compactor::compaction_level compaction, unsigned flags, Xapian::docid last_docid)
 

Private Member Functions

HoneyDatabaseoperator= (const HoneyDatabase &)=delete
 Don't allow assignment. More...
 
 HoneyDatabase (const HoneyDatabase &)=delete
 Don't allow copying. More...
 
void throw_termlist_table_close_exception () const
 

Private Attributes

std::string path
 Path of the directory. More...
 
HoneyVersion version_file
 Version file ("iamhoney"). More...
 
HoneyDocDataTable docdata_table
 
HoneyPostListTable postlist_table
 
HoneyPositionTable position_table
 
HoneySpellingTable spelling_table
 
HoneySynonymTable synonym_table
 
HoneyTermListTable termlist_table
 
HoneyValueManager value_manager
 
Honey::DocLenChunkReader doclen_chunk_reader
 
HoneyCursordoclen_cursor = NULL
 

Friends

class HoneyAllTermsList
 
class HoneyPosPostList
 
class HoneyPostList
 
class HoneySpellingWordsList
 
class HoneySynonymTermList
 
class HoneyTermList
 

Additional Inherited Members

- Public Types inherited from Xapian::Database::Internal
typedef Xapian::doccount size_type
 
- Public Attributes inherited from Xapian::Internal::intrusive_base
unsigned _refs
 Reference count. More...
 
- Protected Types inherited from Xapian::Database::Internal
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 inherited from Xapian::Database::Internal
 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 inherited from Xapian::Database::Internal
transaction_state state
 Current transaction state. More...
 

Detailed Description

Database using honey backend.

Definition at line 48 of file honey_database.h.

Constructor & Destructor Documentation

◆ HoneyDatabase() [1/3]

HoneyDatabase::HoneyDatabase ( const HoneyDatabase )
privatedelete

Don't allow copying.

◆ HoneyDatabase() [2/3]

HoneyDatabase::HoneyDatabase ( std::string_view  path_,
int  flags = Xapian::DB_READONLY_ 
)
explicit

◆ HoneyDatabase() [3/3]

HoneyDatabase::HoneyDatabase ( int  fd,
int  flags = Xapian::DB_READONLY_ 
)
explicit

◆ ~HoneyDatabase()

HoneyDatabase::~HoneyDatabase ( )

Definition at line 103 of file honey_database.cc.

References doclen_cursor.

Member Function Documentation

◆ add_spelling()

void HoneyDatabase::add_spelling ( std::string_view  word,
Xapian::termcount  freqinc 
) const
virtual

Add a word to the spelling dictionary.

If the word is already present, its frequency is increased.

Parameters
wordThe word to add.
freqincHow much to increase its frequency by.

Reimplemented from Xapian::Database::Internal.

Definition at line 373 of file honey_database.cc.

◆ add_synonym()

void HoneyDatabase::add_synonym ( std::string_view  term,
std::string_view  synonym 
) const
virtual

Add a synonym for a term.

If synonym is already a synonym for term, then no action is taken.

Reimplemented from Xapian::Database::Internal.

Definition at line 407 of file honey_database.cc.

References term.

◆ clear_synonyms()

void HoneyDatabase::clear_synonyms ( std::string_view  term) const
virtual

Clear all synonyms for a term.

If term has no synonyms, no action is taken.

Reimplemented from Xapian::Database::Internal.

Definition at line 423 of file honey_database.cc.

References term.

◆ close()

void HoneyDatabase::close ( )
virtual

◆ compact()

void HoneyDatabase::compact ( Xapian::Compactor compactor,
const char *  destdir,
int  fd,
int  source_backend,
const std::vector< const Xapian::Database::Internal * > &  sources,
const std::vector< Xapian::docid > &  offset,
Xapian::Compactor::compaction_level  compaction,
unsigned  flags,
Xapian::docid  last_docid 
)
static

◆ get_backend_info()

int HoneyDatabase::get_backend_info ( std::string *  path) const
virtual

Get backend information about this database.

Parameters
pathIf 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).
Returns
A constant indicating the backend type.

Implements Xapian::Database::Internal.

Definition at line 490 of file honey_database.cc.

References BACKEND_HONEY, and path.

◆ get_description()

string HoneyDatabase::get_description ( ) const
virtual

Return a string describing this object.

Implements Xapian::Database::Internal.

Definition at line 518 of file honey_database.cc.

References path.

◆ get_doccount()

Xapian::doccount HoneyDatabase::get_doccount ( ) const
virtual

◆ get_doclength()

Xapian::termcount HoneyDatabase::get_doclength ( Xapian::docid  did) const
virtual

◆ get_doclength_lower_bound()

Xapian::termcount HoneyDatabase::get_doclength_lower_bound ( ) const
virtual

Get a lower bound on the length of a document in this DB.

Implements Xapian::Database::Internal.

Definition at line 210 of file honey_database.cc.

References HoneyVersion::get_doclength_lower_bound(), and version_file.

◆ get_doclength_upper_bound()

Xapian::termcount HoneyDatabase::get_doclength_upper_bound ( ) const
virtual

Get an upper bound on the length of a document in this DB.

Implements Xapian::Database::Internal.

Definition at line 216 of file honey_database.cc.

References HoneyVersion::get_doclength_upper_bound(), and version_file.

◆ get_freqs()

void HoneyDatabase::get_freqs ( std::string_view  term,
Xapian::doccount termfreq_ptr,
Xapian::termcount collfreq_ptr 
) const
virtual

Returns frequencies for a term.

Parameters
termThe term to get frequencies for
termfreq_ptrPoint to return number of docs indexed by term (or NULL not to return)
collfreq_ptrPoint to return number of occurrences of term in the database (or NULL not to return)

Implements Xapian::Database::Internal.

Definition at line 184 of file honey_database.cc.

References HoneyPostListTable::get_freqs(), postlist_table, and term.

Referenced by HoneyTermList::get_termfreq().

◆ get_lastdocid()

Xapian::docid HoneyDatabase::get_lastdocid ( ) const
virtual

Return the last used document id of this (sub) database.

Implements Xapian::Database::Internal.

Definition at line 122 of file honey_database.cc.

References HoneyVersion::get_last_docid(), and version_file.

Referenced by open_leaf_post_list().

◆ get_metadata()

string HoneyDatabase::get_metadata ( std::string_view  key) const
virtual

Get the metadata associated with a given key.

See Database::get_metadata() for more information.

Reimplemented from Xapian::Database::Internal.

Definition at line 430 of file honey_database.cc.

References HoneyPostListTable::get_metadata(), and postlist_table.

◆ get_postlist_cursor()

HoneyCursor* HoneyDatabase::get_postlist_cursor ( ) const
inline

Definition at line 403 of file honey_database.h.

References HoneyTable::cursor_get(), and postlist_table.

Referenced by get_doclength().

◆ get_revision()

Xapian::rev HoneyDatabase::get_revision ( ) const
virtual

Get the current revision of the database.

Reimplemented from Xapian::Database::Internal.

Definition at line 478 of file honey_database.cc.

References HoneyVersion::get_revision(), and version_file.

◆ get_spelling_frequency()

Xapian::doccount HoneyDatabase::get_spelling_frequency ( std::string_view  word) const
virtual

Return the number of times word was added as a spelling.

Reimplemented from Xapian::Database::Internal.

Definition at line 367 of file honey_database.cc.

References HoneySpellingTable::get_word_frequency(), and spelling_table.

◆ get_total_length()

Xapian::totallength HoneyDatabase::get_total_length ( ) const
virtual

Return the total length of all documents in this database.

Implements Xapian::Database::Internal.

Definition at line 128 of file honey_database.cc.

References HoneyVersion::get_total_doclen(), and version_file.

◆ get_unique_terms()

Xapian::termcount HoneyDatabase::get_unique_terms ( Xapian::docid  did) const
virtual

Get the number of unique terms in document.

Parameters
didThe document id of the document to return this value for.

Implements Xapian::Database::Internal.

Definition at line 164 of file honey_database.cc.

References Assert, and HoneyTermList.

◆ get_unique_terms_lower_bound()

Xapian::termcount HoneyDatabase::get_unique_terms_lower_bound ( ) const
virtual

Get a lower bound on the unique terms size of a document in this DB.

Reimplemented from Xapian::Database::Internal.

Definition at line 239 of file honey_database.cc.

References HoneyVersion::get_unique_terms_lower_bound(), and version_file.

◆ get_unique_terms_upper_bound()

Xapian::termcount HoneyDatabase::get_unique_terms_upper_bound ( ) const
virtual

Get an upper bound on the unique terms size of a document in this DB.

Reimplemented from Xapian::Database::Internal.

Definition at line 245 of file honey_database.cc.

References HoneyVersion::get_unique_terms_upper_bound(), and version_file.

◆ get_used_docid_range()

void HoneyDatabase::get_used_docid_range ( Xapian::docid first,
Xapian::docid last 
) const
virtual

Find lowest and highest docids actually in use.

Only used by compaction, so only needs to be implemented by backends which support compaction.

Reimplemented from Xapian::Database::Internal.

Definition at line 498 of file honey_database.cc.

References HoneyVersion::get_doccount(), HoneyVersion::get_last_docid(), HoneyPostListTable::get_used_docid_range(), postlist_table, and version_file.

◆ get_uuid()

string HoneyDatabase::get_uuid ( ) const
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 from Xapian::Database::Internal.

Definition at line 484 of file honey_database.cc.

References HoneyVersion::get_uuid_string(), and version_file.

◆ get_value_freq()

Xapian::doccount HoneyDatabase::get_value_freq ( Xapian::valueno  slot) const
virtual

Return the frequency of a given value slot.

This is the number of documents which have a (non-empty) value stored in the slot.

Parameters
slotThe value slot to examine.
Exceptions
UnimplementedErrorThe frequency of the value isn't available for this database type.

Implements Xapian::Database::Internal.

Definition at line 192 of file honey_database.cc.

References HoneyValueManager::get_value_freq(), and value_manager.

◆ get_value_lower_bound()

string HoneyDatabase::get_value_lower_bound ( Xapian::valueno  slot) const
virtual

Get a lower bound on the values stored in the given value slot.

If the lower bound isn't available for the given database type, this will return the lowest possible bound - the empty string.

Parameters
slotThe value slot to examine.

Implements Xapian::Database::Internal.

Definition at line 198 of file honey_database.cc.

References HoneyValueManager::get_value_lower_bound(), and value_manager.

◆ get_value_upper_bound()

string HoneyDatabase::get_value_upper_bound ( Xapian::valueno  slot) const
virtual

Get an upper bound on the values stored in the given value slot.

Parameters
slotThe value slot to examine.
Exceptions
UnimplementedErrorThe upper bound of the values isn't available for this database type.

Implements Xapian::Database::Internal.

Definition at line 204 of file honey_database.cc.

References HoneyValueManager::get_value_upper_bound(), and value_manager.

◆ get_wdf_upper_bound()

Xapian::termcount HoneyDatabase::get_wdf_upper_bound ( std::string_view  term) const
virtual

Get an upper bound on the wdf of term term.

Implements Xapian::Database::Internal.

Definition at line 222 of file honey_database.cc.

References HoneyVersion::get_wdf_upper_bound(), HoneyPostListTable::get_wdf_upper_bound(), postlist_table, term, usual, and version_file.

◆ get_wdfdocmax()

Xapian::termcount HoneyDatabase::get_wdfdocmax ( Xapian::docid  did) const
virtual

Get the max wdf in document.

Parameters
didThe document id of the document to return this value for.

Implements Xapian::Database::Internal.

Definition at line 171 of file honey_database.cc.

References Assert, HoneyTermList::get_wdf(), and HoneyTermList::next().

◆ has_positions()

bool HoneyDatabase::has_positions ( ) const
virtual

Check whether this database contains any positional information.

Implements Xapian::Database::Internal.

Definition at line 259 of file honey_database.cc.

References HoneyTable::empty(), and position_table.

◆ has_uncommitted_changes()

bool HoneyDatabase::has_uncommitted_changes ( ) const
inline

Definition at line 395 of file honey_database.h.

Referenced by compact().

◆ open_allterms()

TermList * HoneyDatabase::open_allterms ( std::string_view  prefix) const
virtual

Implements Xapian::Database::Internal.

Definition at line 327 of file honey_database.cc.

References HoneyAllTermsList.

◆ open_document()

Xapian::Document::Internal * HoneyDatabase::open_document ( Xapian::docid  did,
bool  lazy 
) const
virtual

Open a handle on a document.

The returned handle provides access to document data and document values.

Parameters
didThe document id to open.
lazyIf 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.
Returns
A new document object, owned by the caller.

Implements Xapian::Database::Internal.

Definition at line 339 of file honey_database.cc.

References Assert, docdata_table, get_doclength(), and value_manager.

◆ open_leaf_post_list()

LeafPostList * HoneyDatabase::open_leaf_post_list ( std::string_view  term,
bool  need_read_pos 
) const
virtual

Create a LeafPostList for use during a match.

Parameters
termThe term to open a postlist for, or the empty string to create an all-docs postlist.
need_read_posDoes the postlist need to support read_position_list()? Note that open_position_list() may still be called even if need_read_pos is false.

Implements Xapian::Database::Internal.

Definition at line 271 of file honey_database.cc.

References Assert, get_doccount(), get_lastdocid(), HoneyPostListTable::open_post_list(), postlist_table, rare, and term.

Referenced by open_post_list().

◆ open_metadata_keylist()

TermList * HoneyDatabase::open_metadata_keylist ( std::string_view  prefix) const
virtual

Open a termlist returning each metadata key.

Only metadata keys which are associated with a non-empty value will be returned.

Parameters
prefixIf non-empty, only keys with this prefix are returned.

Reimplemented from Xapian::Database::Internal.

Definition at line 436 of file honey_database.cc.

References Assert, HoneyTable::cursor_get(), and postlist_table.

◆ open_position_list()

PositionList * HoneyDatabase::open_position_list ( Xapian::docid  did,
std::string_view  term 
) const
virtual

◆ open_post_list()

PostList * HoneyDatabase::open_post_list ( std::string_view  term) const
virtual

Return a PostList suitable for use in a PostingIterator.

Implements Xapian::Database::Internal.

Definition at line 265 of file honey_database.cc.

References open_leaf_post_list(), and term.

◆ open_spelling_termlist()

TermList * HoneyDatabase::open_spelling_termlist ( std::string_view  word) const
virtual

Create a termlist tree from trigrams of word.

You can assume word.size() > 1.

If there are no trigrams, returns NULL.

Reimplemented from Xapian::Database::Internal.

Definition at line 350 of file honey_database.cc.

References HoneySpellingTable::open_termlist(), and spelling_table.

◆ open_spelling_wordlist()

TermList * HoneyDatabase::open_spelling_wordlist ( ) const
virtual

Return a termlist which returns the words which are spelling correction targets.

If there are no spelling correction targets, returns NULL.

Reimplemented from Xapian::Database::Internal.

Definition at line 356 of file honey_database.cc.

References HoneyTable::cursor_get(), HoneySpellingWordsList, rare, and spelling_table.

◆ open_synonym_keylist()

TermList * HoneyDatabase::open_synonym_keylist ( std::string_view  prefix) const
virtual

Open a termlist returning each term which has synonyms.

Parameters
prefixIf non-empty, only terms with this prefix are returned.

Reimplemented from Xapian::Database::Internal.

Definition at line 396 of file honey_database.cc.

References HoneyTable::cursor_get(), HoneySynonymTermList, rare, and synonym_table.

◆ open_synonym_termlist()

TermList * HoneyDatabase::open_synonym_termlist ( std::string_view  term) const
virtual

Open a termlist returning synonyms for a term.

If term has no synonyms, returns NULL.

Reimplemented from Xapian::Database::Internal.

Definition at line 390 of file honey_database.cc.

References HoneySynonymTable::open_termlist(), synonym_table, and term.

◆ open_term_list()

TermList * HoneyDatabase::open_term_list ( Xapian::docid  did) const
virtual

◆ open_term_list_direct()

TermList * HoneyDatabase::open_term_list_direct ( Xapian::docid  did) const
virtual

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.

Implements Xapian::Database::Internal.

Definition at line 320 of file honey_database.cc.

References open_term_list().

◆ open_value_list()

ValueList * HoneyDatabase::open_value_list ( Xapian::valueno  slot) const
virtual

Open a value stream.

This returns the value in a particular slot for each document.

Parameters
slotThe value slot.
Returns
Pointer to a new ValueList object which should be deleted by the caller once it is no longer needed.

Reimplemented from Xapian::Database::Internal.

Definition at line 290 of file honey_database.cc.

◆ operator=()

HoneyDatabase& HoneyDatabase::operator= ( const HoneyDatabase )
privatedelete

Don't allow assignment.

◆ readahead_for_query()

void HoneyDatabase::readahead_for_query ( const Xapian::Query query) const
virtual

Reimplemented from Xapian::Database::Internal.

Definition at line 109 of file honey_database.cc.

References query().

◆ remove_spelling()

Xapian::termcount HoneyDatabase::remove_spelling ( std::string_view  word,
Xapian::termcount  freqdec 
) const
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.

Parameters
wordThe word to remove.
freqdecHow much to decrease its frequency by.
Returns
Any freqdec not "used up".

Reimplemented from Xapian::Database::Internal.

Definition at line 381 of file honey_database.cc.

◆ remove_synonym()

void HoneyDatabase::remove_synonym ( std::string_view  term,
std::string_view  synonym 
) const
virtual

Remove a synonym for a term.

If synonym isn't a synonym for term, then no action is taken.

Reimplemented from Xapian::Database::Internal.

Definition at line 415 of file honey_database.cc.

References term.

◆ reopen()

bool HoneyDatabase::reopen ( )
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 from Xapian::Database::Internal.

Definition at line 452 of file honey_database.cc.

References HoneyTable::is_open(), postlist_table, and HoneyTable::throw_database_closed().

◆ request_document()

void HoneyDatabase::request_document ( Xapian::docid  did) const
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 from Xapian::Database::Internal.

Definition at line 471 of file honey_database.cc.

References Assert.

◆ set_metadata()

void HoneyDatabase::set_metadata ( std::string_view  key,
std::string_view  value 
)
virtual

Set the metadata associated with a given key.

See WritableDatabase::set_metadata() for more information.

Reimplemented from Xapian::Database::Internal.

Definition at line 444 of file honey_database.cc.

◆ single_file()

bool HoneyDatabase::single_file ( ) const
inline

Definition at line 399 of file honey_database.h.

Referenced by compact().

◆ term_exists()

bool HoneyDatabase::term_exists ( std::string_view  term) const
virtual

◆ throw_termlist_table_close_exception()

void HoneyDatabase::throw_termlist_table_close_exception ( ) const
private

Definition at line 42 of file honey_database.cc.

References HoneyTable::throw_database_closed().

Referenced by open_term_list().

Friends And Related Function Documentation

◆ HoneyAllTermsList

friend class HoneyAllTermsList
friend

Definition at line 49 of file honey_database.h.

Referenced by open_allterms().

◆ HoneyPosPostList

friend class HoneyPosPostList
friend

Definition at line 50 of file honey_database.h.

◆ HoneyPostList

friend class HoneyPostList
friend

Definition at line 51 of file honey_database.h.

◆ HoneySpellingWordsList

friend class HoneySpellingWordsList
friend

Definition at line 52 of file honey_database.h.

Referenced by open_spelling_wordlist().

◆ HoneySynonymTermList

friend class HoneySynonymTermList
friend

Definition at line 53 of file honey_database.h.

Referenced by open_synonym_keylist().

◆ HoneyTermList

friend class HoneyTermList
friend

Definition at line 54 of file honey_database.h.

Referenced by get_unique_terms(), and open_term_list().

Member Data Documentation

◆ docdata_table

HoneyDocDataTable HoneyDatabase::docdata_table
private

Definition at line 68 of file honey_database.h.

Referenced by close(), HoneyDatabase(), and open_document().

◆ doclen_chunk_reader

Honey::DocLenChunkReader HoneyDatabase::doclen_chunk_reader
mutableprivate

Definition at line 82 of file honey_database.h.

Referenced by get_doclength().

◆ doclen_cursor

HoneyCursor* HoneyDatabase::doclen_cursor = NULL
mutableprivate

Definition at line 84 of file honey_database.h.

Referenced by get_doclength(), and ~HoneyDatabase().

◆ path

std::string HoneyDatabase::path
private

Path of the directory.

Definition at line 63 of file honey_database.h.

Referenced by get_backend_info(), GlassDatabase::get_backend_info(), and get_description().

◆ position_table

HoneyPositionTable HoneyDatabase::position_table
private

◆ postlist_table

HoneyPostListTable HoneyDatabase::postlist_table
private

◆ spelling_table

HoneySpellingTable HoneyDatabase::spelling_table
mutableprivate

◆ synonym_table

HoneySynonymTable HoneyDatabase::synonym_table
private

Definition at line 76 of file honey_database.h.

Referenced by close(), HoneyDatabase(), open_synonym_keylist(), and open_synonym_termlist().

◆ termlist_table

HoneyTermListTable HoneyDatabase::termlist_table
private

◆ value_manager

HoneyValueManager HoneyDatabase::value_manager
private

◆ version_file

HoneyVersion HoneyDatabase::version_file
private

The documentation for this class was generated from the following files: