xapian-core  2.0.0
Public Member Functions | Static Public Member Functions | List of all members
HoneyPositionTable Class Reference

#include <honey_positionlist.h>

+ Inheritance diagram for HoneyPositionTable:
+ Collaboration diagram for HoneyPositionTable:

Public Member Functions

 HoneyPositionTable (const std::string &dbdir, bool readonly)
 Create a new HoneyPositionTable object. More...
 
 HoneyPositionTable (int fd, off_t offset_, bool readonly_)
 
HoneyPositionListopen_position_list (Xapian::docid did, std::string_view term) const
 
void pack (std::string &s, const Xapian::VecCOW< Xapian::termpos > &vec) const
 Pack a position list into a string. More...
 
void set_positionlist (Xapian::docid did, std::string_view tname, std::string_view s)
 Set the position list for term tname in document did. More...
 
void delete_positionlist (Xapian::docid did, std::string_view tname)
 Delete the position list for term tname in document did. More...
 
Xapian::termcount positionlist_count (Xapian::docid did, std::string_view term) const
 Return the number of entries in specified position list. More...
 
- Public Member Functions inherited from HoneyLazyTable
 HoneyLazyTable (const char *name_, const std::string &path_, bool readonly)
 Create a new lazy table. More...
 
 HoneyLazyTable (const char *name_, int fd, off_t offset_, bool readonly)
 
- Public Member Functions inherited from HoneyTable
 HoneyTable (const char *, const std::string &path_, bool read_only_, bool lazy_=false)
 
 HoneyTable (const char *, int fd, off_t offset_, bool read_only_, bool lazy_=false)
 
 ~HoneyTable ()
 
bool is_writable () const
 
int get_flags () const
 
void create_and_open (int flags_, const Honey::RootInfo &root_info)
 
void open (int flags_, const Honey::RootInfo &root_info, honey_revision_number_t)
 
void close (bool permanent)
 
const std::string & get_path () const
 
void add (std::string_view key, const char *val, size_t val_size, bool compressed=false)
 
void add (std::string_view key, std::string_view val, bool compressed=false)
 
void flush_db ()
 
void cancel (const Honey::RootInfo &, honey_revision_number_t)
 
void commit (honey_revision_number_t, Honey::RootInfo *root_info)
 
bool sync ()
 
bool empty () const
 
bool get_exact_entry (std::string_view key, std::string &tag) const
 
bool key_exists (const std::string &key) const
 
bool del (const std::string &)
 
bool readahead_key (const std::string &) const
 
bool is_modified () const
 
HoneyCursorcursor_get () const
 
bool exists () const
 
bool is_open () const
 
honey_tablesize_t get_entry_count () const
 
honey_tablesize_t get_approx_entry_count () const
 Return an approximation of the number of entries in the table. More...
 
off_t get_root () const
 
off_t get_offset () const
 

Static Public Member Functions

static std::string make_key (Xapian::docid did, std::string_view term)
 
- Static Public Member Functions inherited from HoneyTable
static void throw_database_closed ()
 

Detailed Description

Definition at line 130 of file honey_positionlist.h.

Constructor & Destructor Documentation

◆ HoneyPositionTable() [1/2]

HoneyPositionTable::HoneyPositionTable ( const std::string &  dbdir,
bool  readonly 
)
inline

Create a new HoneyPositionTable object.

This method does not create or open the table on disk - you must call the create() or open() methods respectively!

Parameters
dbdirThe directory the honey database is stored in.
readonlytrue if we're opening read-only, else false.

Definition at line 147 of file honey_positionlist.h.

◆ HoneyPositionTable() [2/2]

HoneyPositionTable::HoneyPositionTable ( int  fd,
off_t  offset_,
bool  readonly_ 
)
inline

Definition at line 150 of file honey_positionlist.h.

Member Function Documentation

◆ delete_positionlist()

void HoneyPositionTable::delete_positionlist ( Xapian::docid  did,
std::string_view  tname 
)
inline

Delete the position list for term tname in document did.

Definition at line 176 of file honey_positionlist.h.

References HoneyTable::del(), and make_key().

Referenced by HoneyInverter::flush_pos_lists().

◆ make_key()

static std::string HoneyPositionTable::make_key ( Xapian::docid  did,
std::string_view  term 
)
inlinestatic

◆ open_position_list()

HoneyPositionList* HoneyPositionTable::open_position_list ( Xapian::docid  did,
std::string_view  term 
) const
inline

◆ pack()

void HoneyPositionTable::pack ( std::string &  s,
const Xapian::VecCOW< Xapian::termpos > &  vec 
) const

◆ positionlist_count()

Xapian::termcount HoneyPositionTable::positionlist_count ( Xapian::docid  did,
std::string_view  term 
) const

Return the number of entries in specified position list.

Definition at line 55 of file honey_positionlist.cc.

References Xapian::BitReader::decode(), LOGCALL, pos, RETURN, term, and unpack_uint().

Referenced by HoneyTermList::positionlist_count().

◆ set_positionlist()

void HoneyPositionTable::set_positionlist ( Xapian::docid  did,
std::string_view  tname,
std::string_view  s 
)
inline

Set the position list for term tname in document did.

Definition at line 170 of file honey_positionlist.h.

References HoneyTable::add(), and make_key().

Referenced by HoneyInverter::flush_pos_lists().


The documentation for this class was generated from the following files: