21 #ifndef XAPIAN_INCLUDED_GLASS_SYNONYM_H
22 #define XAPIAN_INCLUDED_GLASS_SYNONYM_H
74 void add_synonym(
const std::string & term,
const std::string & synonym);
80 void remove_synonym(
const std::string & term,
const std::string & synonym);
141 const string & prefix_)
Abstract base class for iterating all terms in a database.
database class declarations
Abstract base class for iterating all terms in a database.
A cursor pointing to a position in a Btree table, for reading several entries in order,...
bool find_entry(const string &key)
Position the cursor on the highest entry with key <= key.
void find_entry_lt(const string &key)
Position the cursor on the highest entry with key < key.
GlassSynonymTable(const std::string &dbdir, bool readonly)
Create a new GlassSynonymTable object.
std::string last_term
The last term which was updated.
GlassSynonymTable(int fd, off_t offset_, bool readonly)
void flush_db()
Override methods of GlassTable.
std::set< std::string > last_synonyms
The synonyms for the last term which was updated.
void clear_synonyms(const std::string &term)
Remove all synonyms for term.
void add_synonym(const std::string &term, const std::string &synonym)
Add a synonym for term.
void remove_synonym(const std::string &term, const std::string &synonym)
Remove a synonym for term.
bool is_modified() const
Override methods of GlassTable.
void cancel(const RootInfo &root_info, glass_revision_number_t rev)
Override methods of GlassTable.
TermList * open_termlist(const std::string &term)
Open synonym termlist for a term.
GlassSynonymTermList(const GlassSynonymTermList &)
Copying is not allowed.
Xapian::doccount get_termfreq() const
Return the term frequency for the term at the current position.
TermList * skip_to(const string &tname)
Advance to the first term which is >= tname.
GlassSynonymTermList(Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database_, GlassCursor *cursor_, const string &prefix_)
string prefix
The prefix to restrict the terms to.
~GlassSynonymTermList()
Destructor.
GlassCursor * cursor
A cursor which runs through the synonym table reading termnames from the keys.
bool at_end() const
True if we're off the end of the list.
string get_termname() const
Returns the current termname.
Xapian::Internal::intrusive_ptr< const Xapian::Database::Internal > database
Keep a reference to our database to stop it being deleted.
void operator=(const GlassSynonymTermList &)
Assignment is not allowed.
TermList * next()
Advance to the next term in the list.
void flush_db()
Flush any outstanding changes to the DB file of the table.
bool is_modified() const
Determine whether the object contains uncommitted modifications.
void cancel(const RootInfo &root_info, glass_revision_number_t rev)
Cancel any outstanding changes.
Abstract base class for termlists.
uint4 glass_revision_number_t
The revision number of a glass database.
Subclass of GlassTable for deriving lazy tables from.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Abstract base class for termlists.