21 #ifndef XAPIAN_INCLUDED_HONEY_INVERTER_H
22 #define XAPIAN_INCLUDED_HONEY_INVERTER_H
92 pl_changes.insert(std::make_pair(did, new_wdf));
131 std::map<std::string,
132 std::map<Xapian::docid, std::string>,
137 const std::string& tname,
142 const std::string&
term,
143 const std::string& s);
157 i->second.add_posting(did, wdf);
168 i->second.remove_posting(did, wdf);
180 i->second.update_posting(did, old_wdf, new_wdf);
186 const std::string& tname,
188 bool modifying =
false);
191 const std::string&
term);
194 const std::string&
term,
195 std::string& s)
const;
254 tf_delta = i->second.get_tfdelta();
255 cf_delta = i->second.get_cfdelta();
Class for storing the changes in frequencies for a term.
void remove_posting(Xapian::docid did, Xapian::termcount wdf)
Remove a posting.
PostingChanges(Xapian::docid did, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
Constructor for an updated posting.
std::map< Xapian::docid, Xapian::termcount > pl_changes
Changes to this term's postlist.
Xapian::termcount cf_delta
Change in collection frequency.
Xapian::termcount tf_delta
Change in term frequency.
PostingChanges(Xapian::docid did, Xapian::termcount wdf, bool)
Constructor for a removed posting.
Xapian::termcount get_cfdelta() const
Get the collection frequency delta.
void update_posting(Xapian::docid did, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
Update a posting.
Xapian::termcount get_tfdelta() const
Get the term frequency delta.
PostingChanges(Xapian::docid did, Xapian::termcount wdf)
Constructor for an added posting.
void add_posting(Xapian::docid did, Xapian::termcount wdf)
Add a posting.
Class which "inverts the file".
bool get_doclength(Xapian::docid did, Xapian::termcount &doclen) const
bool get_deltas(std::string_view term, Xapian::termcount &tf_delta, Xapian::termcount &cf_delta) const
void add_posting(Xapian::docid did, const std::string &term, Xapian::doccount wdf)
bool has_positions(const HoneyPositionTable &position_table) const
void store_positions(const HoneyPositionTable &position_table, Xapian::docid did, const std::string &tname, const Xapian::VecCOW< Xapian::termpos > &posvec, bool modifying)
void flush_post_lists(HoneyPostListTable &table, const std::string &pfx)
Flush postlist changes for all terms which start with pfx.
void flush_pos_lists(HoneyPositionTable &table)
Flush position changes.
void flush(HoneyPostListTable &table)
Flush all postlist table changes.
void set_positionlist(Xapian::docid did, const std::string &term, const std::string &s)
static const Xapian::termcount DELETED_POSTING
Magic wdf value used for a deleted posting.
std::map< std::string, PostingChanges, std::less<> > postlist_changes
Buffered changes to postlists.
void flush_post_list(HoneyPostListTable &table, const std::string &term)
Flush postlist changes for term.
void set_doclength(Xapian::docid did, Xapian::termcount doclen, bool add)
void flush_all_post_lists(HoneyPostListTable &table)
Flush postlist changes for all terms.
void flush_doclengths(HoneyPostListTable &table)
Flush document length changes.
void update_posting(Xapian::docid did, const std::string &term, Xapian::termcount old_wdf, Xapian::termcount new_wdf)
void delete_positionlist(Xapian::docid did, const std::string &term)
void remove_posting(Xapian::docid did, const std::string &term, Xapian::doccount wdf)
bool get_positionlist(Xapian::docid did, const std::string &term, std::string &s) const
std::map< std::string, std::map< Xapian::docid, std::string >, std::less<> > pos_changes
Buffered changes to positional data.
void delete_doclength(Xapian::docid did)
std::map< Xapian::docid, Xapian::termcount > doclen_changes
Buffered changes to document lengths.
void add(std::string_view key, const char *val, size_t val_size, bool compressed=false)
Indicates an attempt to access a document not present in the database.
Class for iterating over a list of terms.
Suitable for "simple" type T.
#define UNSIGNED_OVERFLOW_OK(X)
Hierarchy of classes which Xapian can throw as exceptions.
string str(int value)
Convert int to std::string.
The Xapian namespace contains public interfaces for the Xapian library.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Negate unsigned integer, avoiding compiler warnings.
constexpr std::enable_if_t< std::is_unsigned_v< T >, T > negate_unsigned(T value)
Various assertion macros.
Custom vector implementations using small vector optimisation.
Convert types to std::string.