44 position_table.
pack(s, posvec);
46 auto i = pos_changes.find(
term);
47 if (i != pos_changes.end()) {
48 map<Xapian::docid, string>& m = i->second;
63 set_positionlist(did,
term, s);
76 store_positions(position_table, did,
term, *ptr, modifying);
88 store_positions(position_table, did,
term, posvec, modifying);
94 delete_positionlist(did,
term);
102 pos_changes.insert(make_pair(
term, map<Xapian::docid, string>()))
103 .first->second[did] = s;
110 set_positionlist(did,
term,
string());
118 auto i = pos_changes.find(
term);
119 if (i == pos_changes.end())
121 const map<Xapian::docid, string>& m = i->second;
122 auto j = m.find(did);
132 if (pos_changes.empty())
133 return !position_table.
empty();
138 for (
auto i : pos_changes) {
139 const map<Xapian::docid, string>& m = i.second;
141 const string& s = j.second;
156 doclen_changes.clear();
162 auto i = postlist_changes.find(
term);
163 if (i == postlist_changes.end())
return;
167 postlist_changes.erase(i);
173 for (
auto&& i : postlist_changes) {
176 postlist_changes.clear();
183 return flush_all_post_lists(table);
185 auto begin = postlist_changes.lower_bound(pfx);
189 if (pfxinc.back() !=
'\xff') {
191 end = postlist_changes.lower_bound(pfxinc);
194 pfxinc.resize(pfxinc.size() - 1);
195 if (pfxinc.empty()) {
196 end = postlist_changes.end();
201 for (
auto i = begin; i != end; ++i) {
207 postlist_changes.erase(begin, end);
213 flush_doclengths(table);
214 flush_all_post_lists(table);
220 for (
auto i : pos_changes) {
221 const string&
term = i.first;
222 const map<Xapian::docid, string>& m = i.second;
225 const string& s = j.second;
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)
void flush_post_list(HoneyPostListTable &table, const std::string &term)
Flush postlist changes for term.
void flush_all_post_lists(HoneyPostListTable &table)
Flush postlist changes for all terms.
void flush_doclengths(HoneyPostListTable &table)
Flush document length changes.
void delete_positionlist(Xapian::docid did, const std::string &term)
bool get_positionlist(Xapian::docid did, const std::string &term, std::string &s) const
static std::string make_key(Xapian::docid did, std::string_view term)
void delete_positionlist(Xapian::docid did, std::string_view tname)
Delete the position list for term tname in document did.
void pack(std::string &s, const Xapian::VecCOW< Xapian::termpos > &vec) const
Pack a position list into a string.
void set_positionlist(Xapian::docid did, std::string_view tname, std::string_view s)
Set the position list for term tname in document did.
void merge_changes(const std::string &term, const HoneyInverter::PostingChanges &changes)
void merge_doclen_changes(const std::map< Xapian::docid, Xapian::termcount > &changes)
bool get_exact_entry(std::string_view key, std::string *tag) const
honey_tablesize_t get_entry_count() const
Class for iterating over term positions.
virtual const Xapian::VecCOW< Xapian::termpos > * get_vec_termpos() const
Get pointer to VecCOW<termpos> if that's the internal representation.
Class for iterating over a list of terms.
PositionIterator positionlist_end() const noexcept
Return an end PositionIterator for the current term.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
PositionIterator positionlist_begin() const
Return a PositionIterator for the current term.
Suitable for "simple" type T.
void reserve(size_type n)
unsigned long long honey_tablesize_t
How many entries there are in a table.
HoneyInverter class which "inverts the file".
A position list in a honey database.
PostList in a honey database.
Subclass of HoneyTable which holds postlists.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Abstract base class for termlists.