22 #ifndef XAPIAN_INCLUDED_HONEY_POSTLIST_H
23 #define XAPIAN_INCLUDED_HONEY_POSTLIST_H
30 #include <string_view>
59 if (key.size() <
term.size()) {
63 const char*
p = key.data();
64 const char* end =
p + key.size();
66 std::string term_in_key;
70 if (term_in_key !=
term)
79 const char*
p =
nullptr;
189 std::string_view term_,
232 std::string_view term_,
Database using honey backend.
PostList in a honey database with positions.
HoneyRePositionList position_list
PositionList object to reuse for OP_NEAR and OP_PHRASE.
std::string get_description() const
Return a string description of this object.
HoneyPosPostList(const HoneyDatabase *db_, std::string_view term_, HoneyCursor *cursor_)
PositionList * read_position_list()
Read the position list for the term in the current document and return a pointer to it (owned by the ...
PostList in a honey database.
Xapian::termcount get_wdf() const
Return the wdf for the document at the current position.
Xapian::docid last_did
The highest document id in this posting list.
PositionList * open_position_list() const
Read the position list for the term in the current document and return a pointer to it (not owned by ...
Xapian::termcount wdf_max
Maximum wdf for this postlist.
bool open_nearby_postlist(std::string_view term_, bool need_read_pos, LeafPostList *&pl) const
Open another postlist from the same database.
HoneyCursor * cursor
Cursor on the postlist table.
Xapian::termcount get_wdf_upper_bound() const
const HoneyDatabase * db
HoneyDatabase to get position table object from.
void get_docid_range(Xapian::docid &first, Xapian::docid &last) const
Get the bounds on the range of docids this PostList can return.
PostList * skip_to(Xapian::docid did, double w_min)
Skip forward to the specified docid.
HoneyPostList & operator=(const HoneyPostList &)=delete
Don't allow assignment.
Honey::PostingChunkReader reader
bool update_reader()
Update reader to use the chunk currently pointed to by cursor.
HoneyPostList(const HoneyPostList &)=delete
Don't allow copying.
Xapian::docid get_docid() const
Return the current docid.
bool started
Needed so that first next() does nothing.
std::string get_description() const
Return a string description of this object.
bool at_end() const
Return true if the current position is past the last entry in this list.
A reusable position list in a honey database.
Xapian::doccount termfreq
PostingChunkReader()
Create an uninitialised PostingChunkReader.
void init()
Initialise already at_end().
Xapian::docid get_docid() const
Xapian::docid last_did
The last docid in this chunk.
Xapian::termcount collfreq_info
Value "to do with" collection frequency.
void assign(const char *p_, size_t len, Xapian::docid did)
Xapian::termcount get_wdf() const
bool next()
Advance, returning false if we've run out of data.
bool skip_to(Xapian::docid target)
Skip ahead, returning false if we've run out of data.
void init(Xapian::doccount tf, Xapian::termcount cf_info)
Initialise.
Abstract base class for leaf postlists.
DatabaseCorruptError indicates database corruption was detected.
Abstract base class for postlists.
PostList * next()
Advance the current position to the next document in the postlist.
Abstract base class for iterating term positions in a document.
A position list in a honey database.
Abstract base class for leaf postlists.
std::string make_postingchunk_key(std::string_view term)
Generate a key for a posting initial 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.
bool unpack_string_preserving_sort(const char **p, const char *end, std::string &result)
Decode a "sort preserved" std::string from a string.
void pack_string_preserving_sort(std::string &s, std::string_view value, bool last=false)
Append an encoded std::string to a string, preserving the sort order.
bool unpack_uint_preserving_sort(const char **p, const char *end, U *result)
Decode a "sort preserved" unsigned integer from a string.
void pack_uint_preserving_sort(std::string &s, U value)
Append an encoded unsigned integer to a string, preserving the sort order.