39 LOGCALL_VOID(DB,
"HoneyAllTermsList::read_termfreq", NO_ARGS);
45 const char*
p = cursor->current_tag.data();
46 const char* pend =
p + cursor->current_tag.size();
48 termfreq, collfreq)) {
68 return database->postlist_table.get_approx_entry_count();
76 if (termfreq == 0) read_termfreq();
90 cursor = database->postlist_table.cursor_get();
94 (void)cursor->find_entry_ge(
string(
"\x00\xff", 2));
97 if (cursor->find_entry_ge(key)) {
100 current_term = prefix;
104 if (cursor->after_end()) {
111 if (!cursor->next()) {
118 auto nul = cursor->current_key.find(
'\0');
119 if (nul == string::npos) {
120 current_term = cursor->current_key;
123 if (cursor->current_key[nul + 1] !=
'\xff') {
127 const char*
p = cursor->current_key.data();
128 const char* pend =
p + cursor->current_key.size();
131 "unexpected format");
137 if (
p == pend)
break;
160 cursor = database->postlist_table.cursor_get();
169 if (cursor->find_entry_ge(key)) {
174 if (cursor->after_end()) {
178 const char*
p = cursor->current_key.data();
179 const char* pend =
p + cursor->current_key.size();
183 "unexpected format");
Xapian::doccount get_termfreq() const
Returns the term frequency of the current term.
Xapian::termcount get_approx_size() const
Return approximate size of this termlist.
TermList * next()
Advance to the next term in the list.
void read_termfreq() const
Read and cache the term frequency.
TermList * skip_to(std::string_view term)
Advance to the first term which is >= term.
~HoneyAllTermsList()
Destructor.
DatabaseCorruptError indicates database corruption was detected.
Abstract base class for termlists.
#define LOGCALL(CATEGORY, TYPE, FUNC, PARAMS)
#define LOGCALL_VOID(CATEGORY, FUNC, PARAMS)
#define LOGCALL_DTOR(CATEGORY, CLASS)
Hierarchy of classes which Xapian can throw as exceptions.
A termlist containing all terms in a honey database.
PostList in a honey database.
Encoding and decoding functions for honey postlists.
bool decode_initial_chunk_header_freqs(const char **p, const char *end, Xapian::doccount &termfreq, Xapian::termcount &collfreq)
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Pack types into strings and unpack them again.
std::string pack_honey_postlist_key(std::string_view term)
bool unpack_string_preserving_sort(const char **p, const char *end, std::string &result)
Decode a "sort preserved" std::string from a string.
Various handy string-related helpers.
bool startswith(std::string_view s, char pfx)