24 #ifndef XAPIAN_INCLUDED_GLASS_POSTLIST_H
25 #define XAPIAN_INCLUDED_GLASS_POSTLIST_H
38 #include <string_view>
44 class PostlistChunkReader;
45 class PostlistChunkWriter;
148 std::string_view
term,
156 std::string_view
term,
157 bool keep_reference);
229 :
GlassTable(
"postlist", path_ +
"/postlist.", readonly_),
234 :
GlassTable(
"postlist", fd, offset_, readonly_),
298 #ifdef DISABLE_GPL_LIBXAPIAN
299 # error GPL source we cannot relicense included in libxapian
A cursor pointing to a position in a Btree table, for reading several entries in order,...
A backend designed for efficient indexing and retrieval, using compressed posting lists and a btree s...
void open(int flags_, const RootInfo &root_info, glass_revision_number_t rev)
GlassPostListTable(int fd, off_t offset_, bool readonly_)
Xapian::docid get_chunk(std::string_view tname, Xapian::docid did, bool adding, Glass::PostlistChunkReader **from, Glass::PostlistChunkWriter **to)
bool document_exists(Xapian::docid did, Xapian::Internal::intrusive_ptr< const GlassDatabase > db) const
Check if document did exists.
GlassPostListTable(const std::string &path_, bool readonly_)
Create a new table object.
void get_used_docid_range(Xapian::docid &first, Xapian::docid &last) const
static std::string make_key(std::string_view term, Xapian::docid did)
Compose a key from a termname and docid.
Xapian::termcount get_doclength(Xapian::docid did, Xapian::Internal::intrusive_ptr< const GlassDatabase > db) const
Returns the length of document did.
void merge_changes(std::string_view term, const Inverter::PostingChanges &changes)
Merge changes for a term.
static std::string make_key(std::string_view term)
Compose a key from a termname.
bool term_exists(std::string_view term) const
void get_freqs(std::string_view term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr, Xapian::termcount *wdfub_ptr=NULL) const
Returns frequencies for a term.
void merge_doclen_changes(const std::map< Xapian::docid, Xapian::termcount > &doclens)
Merge document length changes.
std::unique_ptr< GlassPostList > doclen_pl
PostList for looking up document lengths.
A postlist in a glass database.
Xapian::docid get_docid() const
Returns the current docid.
bool have_started
Whether we've started reading the list yet.
Xapian::docid did
Document id we're currently at.
bool move_forward_in_chunk_to_at_least(Xapian::docid desired_did)
Scan forward in the current chunk for the specified document ID.
Xapian::docid first_did_in_chunk
The first document id in this chunk.
bool current_chunk_contains(Xapian::docid desired_did)
Return true if the given document ID lies in the range covered by the current chunk.
void move_to_chunk_containing(Xapian::docid desired_did)
Move to chunk containing the specified document ID.
PositionList * open_position_list() const
Get the list of positions of the term in the current document.
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 desired_did, double w_min)
Skip to next document with docid >= docid.
Xapian::termcount wdf_upper_bound
Upper bound on wdf for this postlist.
bool is_at_end
Whether we've run off the end of the list yet.
bool next_in_chunk()
Move to the next item in the chunk, if possible.
static void read_freqs(const char **posptr, const char *end, Xapian::doccount *number_of_entries_ptr, Xapian::termcount *collection_freq_ptr)
Read the term frequency and collection frequency.
std::string get_description() const
Get a description of the document.
Xapian::docid last_did_in_chunk
The last document id in this chunk.
Xapian::Internal::intrusive_ptr< const GlassDatabase > this_db
The database we are searching.
Xapian::termcount get_wdf_upper_bound() const
Xapian::termcount get_wdf() const
Returns the Within Document Frequency of the term in the current document.
bool open_nearby_postlist(std::string_view term_, bool need_read_pos, LeafPostList *&pl) const
Open another postlist from the same database.
GlassPostList(const GlassPostList &)
Copying is not allowed.
bool jump_to(Xapian::docid desired_did)
Used for looking up doclens.
~GlassPostList()
Destructor.
GlassRePositionList * positionlist
The position list object for this posting list.
PositionList * read_position_list()
Get the list of positions of the term in the current document.
const char * end
Pointer to byte after end of current chunk.
const char * pos
Position of iteration through current chunk.
bool at_end() const
Return true if and only if we're off the end of the list.
bool is_last_chunk
True if this is the last chunk.
void operator=(const GlassPostList &)
Assignment is not allowed.
void next_chunk()
Move to the next chunk.
std::unique_ptr< GlassCursor > cursor
Cursor pointing to current chunk of postlist.
Xapian::termcount wdf
The wdf of the current document.
A reusable position list in a glass database.
Class managing a Btree table in a Glass database.
bool key_exists(std::string_view key) const
Check if a key exists in the Btree.
void open(int flags_, const RootInfo &root_info, glass_revision_number_t rev)
Open the btree.
PostlistChunkReader is essentially an iterator wrapper around a postlist chunk.
PostlistChunkWriter is a wrapper which acts roughly as an output iterator on a postlist chunk,...
Class for storing the changes in frequencies for a term.
Abstract base class for leaf postlists.
std::string term
The term name for this postlist (empty for an alldocs postlist).
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.
An indexed database of documents.
Definitions, types, etc for use inside glass.
uint4 glass_revision_number_t
The revision number of a glass database.
Inverter class which "inverts the file".
A position list in a glass database.
Abstract base class for leaf postlists.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Various assertion macros.
std::string pack_glass_postlist_key(std::string_view term)