22 #ifndef XAPIAN_INCLUDED_HONEY_ALLDOCSPOSTLIST_H
23 #define XAPIAN_INCLUDED_HONEY_ALLDOCSPOSTLIST_H
26 # error config.h must be included first in each C++ source file
45 std::string key(1,
'\0');
48 int width = (do_clz(last_did) >> 3) + 1;
51 for (
auto v = last_did; v; v >>= 8) {
57 #ifndef WORDS_BIGENDIAN
60 key.append(
reinterpret_cast<const char*
>(&v) + (
sizeof(v) - width), width);
67 const char*
p = key.data();
68 const char* end =
p + key.length();
69 if (end -
p < 3 || *
p++ !=
'\0') {
73 unsigned char code = *
p++;
82 memcpy(
reinterpret_cast<char*
>(&v) + (
sizeof(v) - width),
p, width);
83 #ifndef WORDS_BIGENDIAN
91 unsigned const char*
p =
nullptr;
92 unsigned const char*
end;
HoneyAllDocsPostList(const HoneyAllDocsPostList &)=delete
Don't allow copying.
Xapian::docid get_docid() const
Return the current docid.
Honey::DocLenChunkReader reader
Xapian::termcount get_wdf_upper_bound() const
bool at_end() const
Return true if the current position is past the last entry in this list.
std::string get_description() const
Return a string description of this object.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
PostList * check(Xapian::docid did, double w_min, bool &valid)
Check if the specified docid occurs in this postlist.
HoneyCursor * cursor
Cursor on the postlist table.
HoneyAllDocsPostList & operator=(const HoneyAllDocsPostList &)=delete
Don't allow assignment.
Database using honey backend.
Xapian::termcount back()
Return the last document length in this chunk.
bool find_doclength(Xapian::docid target)
Searches the whole chunk (skip_to() only advances).
bool update(HoneyCursor *cursor)
Update to use the chunk currently pointed to by cursor.
Xapian::termcount get_doclength() const
unsigned const char * end
Xapian::docid get_docid() const
bool read_doclen(const unsigned char *q)
DocLenChunkReader()
Create a DocLenChunkReader which is already at_end().
bool skip_to(Xapian::docid target)
Abstract base class for leaf postlists.
Abstract base class for postlists.
PostList * next()
Advance the current position to the next document in the postlist.
Definitions, types, etc for use inside honey.
Abstract base class for leaf postlists.
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.
Pack types into strings and unpack them again.
functions for reading and writing different width words
uint16_t do_bswap(uint16_t value)