25 #ifndef OM_HGUARD_DATABASE_H 26 #define OM_HGUARD_DATABASE_H 53 struct ReplicationInfo;
154 virtual void get_freqs(
const string & term,
201 virtual bool term_exists(
const string & tname)
const = 0;
273 const string & tname)
const = 0;
350 virtual void add_synonym(
const string & term,
const string & synonym)
const;
356 virtual void remove_synonym(
const string & term,
const string & synonym)
const;
384 virtual void set_metadata(
const string & key,
const string & value);
395 virtual void close() = 0;
481 const std::string & start_revision,
536 virtual bool locked()
const;
The Xapian namespace contains public interfaces for the Xapian library.
void operator=(const Internal &)
Assignment is not allowed.
virtual void replace_document(Xapian::docid did, const Xapian::Document &document)
Replace a given document in the database.
virtual Xapian::doccount get_value_freq(Xapian::valueno slot) const =0
Return the frequency of a given value slot.
virtual TermList * open_term_list(Xapian::docid did) const =0
Open a term list.
virtual ValueList * open_value_list(Xapian::valueno slot) const
Open a value stream.
bool transaction_active() const
virtual Xapian::docid add_document(const Xapian::Document &document)
Add a new document to the database.
virtual void commit()
Commit pending modifications to the database.
virtual TermList * open_spelling_wordlist() const
Return a termlist which returns the words which are spelling correction targets.
Base class for databases.
void begin_transaction(bool flushed)
Begin a transaction.
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
Internal()
Create a database - called only by derived classes.
virtual bool reopen()
Reopen the database to the latest available revision.
virtual Xapian::termcount get_wdf_upper_bound(const std::string &term) const
Get an upper bound on the wdf of term term.
virtual void clear_synonyms(const string &term) const
Clear all synonyms for a term.
A document in the database, possibly plus modifications.
Abstract base class for termlists.
virtual bool has_positions() const =0
Check whether this database contains any positional information.
virtual void set_metadata(const string &key, const string &value)
Set the metadata associated with a given key.
Abstract base class for leaf postlists.
virtual LeafPostList * open_post_list(const string &tname) const =0
Open a posting list.
virtual Xapian::termcount get_doclength_upper_bound() const
Get an upper bound on the length of a document in this DB.
virtual void readahead_for_query(const Xapian::Query &query)
Class for iterating over term positions.
virtual string get_uuid() const
Get a UUID for the database.
virtual bool term_exists(const string &tname) const =0
Check whether a given term is in the database.
virtual void delete_document(Xapian::docid did)
Delete a document in the database.
virtual PositionList * open_position_list(Xapian::docid did, const string &tname) const =0
Open a position list for the given term in the given document.
enum Xapian::Database::Internal::@2 transaction_state
Transaction state.
virtual Xapian::termcount get_unique_terms(Xapian::docid did) const =0
Get the number of unique term in document.
virtual void add_synonym(const string &term, const string &synonym) const
Add a synonym for a term.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
virtual std::string get_value_upper_bound(Xapian::valueno slot) const =0
Get an upper bound on the values stored in the given value slot.
virtual Xapian::docid get_lastdocid() const =0
Return the last used document id of this (sub) database.
virtual Xapian::termcount get_doclength_lower_bound() const
Get a lower bound on the length of a document in this DB.
virtual bool locked() const
Return true if the database is open for writing.
virtual TermList * open_synonym_termlist(const string &term) const
Open a termlist returning synonyms for a term.
virtual Xapian::Document::Internal * collect_document(Xapian::docid did) const
Request and later collect a document from the database.
virtual TermList * open_allterms(const string &prefix) const =0
Open an allterms list.
virtual void remove_synonym(const string &term, const string &synonym) const
Remove a synonym for a term.
API for working with Xapian databases.
virtual string get_revision_info() const
Get a string describing the current revision of the database.
virtual ~Internal()
Destroy the database.
virtual int get_backend_info(string *path) const =0
Get backend information about this database.
Information about the steps involved in performing a replication.
Class for iterating over document values.
virtual void remove_spelling(const string &word, Xapian::termcount freqdec) const
Remove a word from the spelling dictionary.
Xapian::ValueIterator::Internal ValueList
RemoteDatabase is the baseclass for remote database implementations.
Base class for objects managed by intrusive_ptr.
virtual Xapian::doccount get_spelling_frequency(const string &word) const
Return the number of times word was added as a spelling.
virtual Xapian::totallength get_total_length() const =0
Return the total length of all documents in this database.
virtual std::string get_value_lower_bound(Xapian::valueno slot) const =0
Get a lower bound on the values stored in the given value slot.
virtual TermList * open_metadata_keylist(const std::string &prefix) const
Open a termlist returning each metadata key.
Abstract base class for value streams.
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
void commit_transaction()
Commit a transaction.
virtual TermList * open_spelling_termlist(const string &word) const
Create a termlist tree from trigrams of word.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Xapian::TermIterator::Internal TermList
virtual string get_metadata(const string &key) const
Get the metadata associated with a given key.
virtual void add_spelling(const string &word, Xapian::termcount freqinc) const
Add a word to the spelling dictionary.
virtual void get_freqs(const string &term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const =0
Returns frequencies for a term.
unsigned valueno
The number for a value slot in a document.
virtual void invalidate_doc_object(Xapian::Document::Internal *obj) const
Notify the database that document is no longer valid.
void dtor_called()
Internal method to perform cleanup when a writable database is destroyed with uncommitted changes...
virtual void close()=0
Close the database.
virtual Xapian::doccount get_doccount() const =0
Return the number of docs in this (sub) database.
virtual void write_changesets_to_fd(int fd, const std::string &start_revision, bool need_whole_db, Xapian::ReplicationInfo *info)
Write a set of changesets to a file descriptor.
virtual void cancel()
Cancel pending modifications to the database.
virtual void request_document(Xapian::docid) const
Request and later collect a document from the database.
virtual void keep_alive()
Send a keep-alive signal to a remote database, to stop it from timing out.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Class representing a query.
Abstract base class for iterating term positions in a document.
Xapian::PositionIterator::Internal PositionList
API for working with documents.
virtual Xapian::termcount get_doclength(Xapian::docid did) const =0
Get the length of a given document.
Class for iterating over a list of terms.
virtual void get_used_docid_range(Xapian::docid &first, Xapian::docid &last) const
Find lowest and highest docids actually in use.
virtual Xapian::Document::Internal * open_document(Xapian::docid did, bool lazy) const =0
Open a document.
void cancel_transaction()
Cancel a transaction.
A handle representing a document in a Xapian database.
virtual TermList * open_synonym_keylist(const string &prefix) const
Open a termlist returning each term which has synonyms.