21 #ifndef XAPIAN_INCLUDED_HONEY_INVERTER_H
22 #define XAPIAN_INCLUDED_HONEY_INVERTER_H
92 pl_changes.insert(std::make_pair(did, new_wdf));
139 std::map<std::string,
140 std::map<Xapian::docid, std::string>,
145 std::string_view
term,
150 std::string_view
term,
165 i->second.add_posting(did, wdf);
176 i->second.remove_posting(did, wdf);
188 i->second.update_posting(did, old_wdf, new_wdf);
194 std::string_view
term,
196 bool modifying =
false);
199 std::string_view
term);
202 std::string_view
term,
203 std::string& s)
const;
263 tf_delta = i->second.get_tfdelta();
264 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".
void delete_positionlist(Xapian::docid did, std::string_view term)
bool get_doclength(Xapian::docid did, Xapian::termcount &doclen) const
bool get_positionlist(Xapian::docid did, std::string_view term, std::string &s) const
bool get_deltas(std::string_view term, Xapian::termcount &tf_delta, Xapian::termcount &cf_delta) const
void store_positions(const HoneyPositionTable &position_table, Xapian::docid did, std::string_view term, const Xapian::VecCOW< Xapian::termpos > &posvec, bool modifying)
void add_posting(Xapian::docid did, const std::string &term, Xapian::doccount wdf)
bool has_positions(const HoneyPositionTable &position_table) const
void flush_pos_lists(HoneyPositionTable &table)
Flush position changes.
void flush(HoneyPostListTable &table)
Flush all postlist table changes.
static const Xapian::termcount DELETED_POSTING
Magic wdf value used for a deleted posting.
void flush_post_list(HoneyPostListTable &table, std::string_view term)
Flush postlist changes for term.
std::map< std::string, PostingChanges, std::less<> > postlist_changes
Buffered changes to postlists.
void set_positionlist(Xapian::docid did, std::string_view term, std::string_view s)
void set_doclength(Xapian::docid did, Xapian::termcount doclen, bool add)
void flush_all_post_lists(HoneyPostListTable &table)
Flush postlist changes for all terms.
int has_positions_cache
Cached answer to Inverter::has_positions().
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 flush_post_lists(HoneyPostListTable &table, std::string_view pfx)
Flush postlist changes for all terms which start with pfx.
void remove_posting(Xapian::docid did, const std::string &term, Xapian::doccount wdf)
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.