21 #ifndef XAPIAN_INCLUDED_HONEY_POSITIONLIST_H
22 #define XAPIAN_INCLUDED_HONEY_POSITIONLIST_H
33 #include <string_view>
64 void set_data(
const std::string& data);
154 std::string_view
term)
const {
155 std::string pos_data;
171 std::string_view s) {
182 std::string_view
term)
const;
Classes to encode/decode a bitstream.
Base-class for a position list in a honey database.
Xapian::termcount size
Number of entries.
void set_data(const std::string &data)
Set positional data and start to decode it.
bool skip_to(Xapian::termpos termpos)
Advance to the first term position which is at least termpos.
Xapian::termcount get_approx_size() const
Returns size of position list.
HoneyBasePositionList & operator=(const HoneyBasePositionList &)=delete
Assignment is not allowed.
BitReader rd
Interpolative decoder.
Xapian::termpos current_pos
Current entry.
HoneyBasePositionList()
Default constructor.
Xapian::termpos back() const
Return the final entry in this positionlist.
bool have_started
Have we started iterating yet?
Xapian::termpos get_position() const
Returns current position.
Xapian::termpos last
Last entry.
bool next()
Advance to the next term position in the list.
HoneyBasePositionList(const HoneyBasePositionList &)=delete
Copying is not allowed.
A position list in a honey database.
HoneyPositionList & operator=(const HoneyPositionList &)=delete
Assignment is not allowed.
std::string pos_data
The encoded positional data being read by rd.
HoneyPositionList(const HoneyPositionList &)=delete
Copying is not allowed.
HoneyPositionList * open_position_list(Xapian::docid did, std::string_view term) const
HoneyPositionTable(const std::string &dbdir, bool readonly)
Create a new HoneyPositionTable object.
static std::string make_key(Xapian::docid did, std::string_view term)
Xapian::termcount positionlist_count(Xapian::docid did, std::string_view term) const
Return the number of entries in specified position list.
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.
HoneyPositionTable(int fd, off_t offset_, bool readonly_)
void set_positionlist(Xapian::docid did, std::string_view tname, std::string_view s)
Set the position list for term tname in document did.
A reusable position list in a honey database.
HoneyRePositionList & operator=(const HoneyRePositionList &)=delete
Assignment is not allowed.
HoneyRePositionList(const HoneyRePositionList &)=delete
Copying is not allowed.
HoneyCursor cursor
Cursor for locating multiple entries efficiently.
void read_data(Xapian::docid did, const std::string &term)
Fill list with data, and move the position to the start.
void assign_data(std::string &&data)
Fill list with data, and move the position to the start.
HoneyRePositionList(const HoneyTable &table)
Constructor.
bool get_exact_entry(std::string_view key, std::string *tag) const
void add(std::string_view key, const char *val, size_t val_size, bool compressed=false)
bool del(const std::string &)
Read a stream created by BitWriter.
Abstract base class for iterating term positions in a document.
Suitable for "simple" type T.
Subclass of HoneyTable for deriving lazy tables from.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Pack types into strings and unpack them again.
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.
void pack_uint_preserving_sort(std::string &s, U value)
Append an encoded unsigned integer to a string, preserving the sort order.
Abstract base class for iterating term positions in a document.