33 #include <string_view>
35 using namespace Honey;
40 std::string_view
term,
41 bool need_read_pos)
const
46 unique_ptr<HoneyCursor> cursor(cursor_get());
63 if (termfreq_ptr) *termfreq_ptr = 0;
64 if (collfreq_ptr) *collfreq_ptr = 0;
68 const char*
p = chunk.data();
69 const char* pend =
p + chunk.size();
74 if (termfreq_ptr) *termfreq_ptr = tf;
75 if (collfreq_ptr) *collfreq_ptr = cf;
83 unique_ptr<HoneyCursor> cursor(cursor_get());
86 static const char doclen_key_prefix[2] = {
89 if (cursor->find_entry_ge(
string(doclen_key_prefix, 2))) {
93 Assert(!cursor->after_end());
95 if (last_in_first_chunk == 0) {
100 unsigned width = cursor->current_tag[0] / 8;
101 first = last_in_first_chunk - (cursor->current_tag.size() - 2) / width;
112 if (cursor->after_end())
122 }
while (cursor->next());
137 const char*
p = chunk.data();
138 const char* pend =
p + chunk.size();
Database using honey backend.
PostList in a honey database with positions.
void get_used_docid_range(Xapian::doccount doccount, Xapian::docid &first, Xapian::docid &last) const
void get_freqs(std::string_view term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const
HoneyPostList * open_post_list(const HoneyDatabase *db, std::string_view term, bool need_read_pos) const
Xapian::termcount get_wdf_upper_bound(std::string_view term) const
PostList in a honey database.
DatabaseCorruptError indicates database corruption was detected.
A PostList which iterates over all documents in a HoneyDatabase.
Database using honey backend.
Definitions, types, etc for use inside honey.
PostList in a honey database.
Encoding and decoding functions for honey postlists.
bool decode_initial_chunk_header(const char **p, const char *end, Xapian::doccount &termfreq, Xapian::termcount &collfreq, Xapian::docid &first, Xapian::docid &last, Xapian::docid &chunk_last, Xapian::termcount &first_wdf, Xapian::termcount &wdf_max)
bool decode_initial_chunk_header_freqs(const char **p, const char *end, Xapian::doccount &termfreq, Xapian::termcount &collfreq)
Subclass of HoneyTable which holds postlists.
std::string make_postingchunk_key(std::string_view term)
Generate a key for a posting initial chunk.
std::string make_doclenchunk_key(Xapian::docid last_did)
Generate a key for a doclen chunk.
Xapian::docid docid_from_key(const std::string &key)
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.