xapian-core  2.0.0
Public Member Functions | Private Attributes | List of all members
HoneyPosPostList Class Reference

PostList in a honey database with positions. More...

#include <honey_postlist.h>

+ Inheritance diagram for HoneyPosPostList:
+ Collaboration diagram for HoneyPosPostList:

Public Member Functions

 HoneyPosPostList (const HoneyDatabase *db_, std::string_view term_, HoneyCursor *cursor_)
 
PositionListread_position_list ()
 Read the position list for the term in the current document and return a pointer to it (owned by the PostList). More...
 
std::string get_description () const
 Return a string description of this object. More...
 
- Public Member Functions inherited from HoneyPostList
 HoneyPostList (const HoneyDatabase *db_, std::string_view term_, HoneyCursor *cursor_)
 Create HoneyPostList from already positioned cursor_. More...
 
 ~HoneyPostList ()
 
bool open_nearby_postlist (std::string_view term_, bool need_read_pos, LeafPostList *&pl) const
 Open another postlist from the same database. More...
 
Xapian::docid get_docid () const
 Return the current docid. More...
 
Xapian::termcount get_wdf () const
 Return the wdf for the document at the current position. More...
 
bool at_end () const
 Return true if the current position is past the last entry in this list. More...
 
PositionListopen_position_list () const
 Read the position list for the term in the current document and return a pointer to it (not owned by the PostList). More...
 
PostListnext (double w_min)
 Advance the current position to the next document in the postlist. More...
 
PostListskip_to (Xapian::docid did, double w_min)
 Skip forward to the specified docid. More...
 
Xapian::termcount get_wdf_upper_bound () const
 
void get_docid_range (Xapian::docid &first, Xapian::docid &last) const
 Get the bounds on the range of docids this PostList can return. More...
 
- Public Member Functions inherited from LeafPostList
 ~LeafPostList ()
 
Xapian::termcount get_collfreq () const
 Get the collection frequency of the term. More...
 
void set_termweight (const Xapian::Weight *weight_)
 Set the weighting scheme to use during matching. More...
 
double resolve_lazy_termweight (Xapian::Weight *weight_, Xapian::Weight::Internal *stats, Xapian::termcount qlen, Xapian::termcount wqf, double factor, const Xapian::Database::Internal *shard)
 
double get_weight (Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
 Return the weight contribution for the current position. More...
 
double recalc_maxweight ()
 Recalculate the upper bound on what get_weight() can return. More...
 
Xapian::termcount count_matching_subqs () const
 Count the number of leaf subqueries which match at the current position. More...
 
void gather_position_lists (OrPositionList *orposlist)
 Gather PositionList* objects for a subtree. More...
 
const std::string & get_term () const
 Get the term name. More...
 
void set_term (std::string_view term_)
 Set the term name. More...
 
- Public Member Functions inherited from Xapian::Internal::PostList
virtual ~PostList ()
 We have virtual methods and want to be able to delete derived classes using a pointer to the base class, so we need a virtual destructor. More...
 
Xapian::doccount get_termfreq () const
 Get an estimate of the number of documents this PostList will return. More...
 
virtual PostListcheck (Xapian::docid did, double w_min, bool &valid)
 Check if the specified docid occurs in this postlist. More...
 
PostListnext ()
 Advance the current position to the next document in the postlist. More...
 
PostListskip_to (Xapian::docid did)
 Skip forward to the specified docid. More...
 

Private Attributes

HoneyRePositionList position_list
 PositionList object to reuse for OP_NEAR and OP_PHRASE. More...
 

Additional Inherited Members

- Protected Member Functions inherited from LeafPostList
 LeafPostList (std::string_view term_)
 Only constructable as a base class for derived classes. More...
 
- Protected Member Functions inherited from Xapian::Internal::PostList
 PostList ()
 Only constructable as a base class for derived classes. More...
 
- Protected Attributes inherited from LeafPostList
const Xapian::Weightweight = nullptr
 
std::string term
 The term name for this postlist (empty for an alldocs postlist). More...
 
Xapian::termcount collfreq
 The collection frequency of the term. More...
 
- Protected Attributes inherited from Xapian::Internal::PostList
Xapian::doccount termfreq
 Estimate of the number of documents this PostList will return. More...
 

Detailed Description

PostList in a honey database with positions.

Use a special subclass to avoid the size cost for the common case where we don't want positional data.

Definition at line 222 of file honey_postlist.h.

Constructor & Destructor Documentation

◆ HoneyPosPostList()

HoneyPosPostList::HoneyPosPostList ( const HoneyDatabase db_,
std::string_view  term_,
HoneyCursor cursor_ 
)

Definition at line 272 of file honey_postlist.cc.

Member Function Documentation

◆ get_description()

string HoneyPosPostList::get_description ( ) const
virtual

Return a string description of this object.

Reimplemented from HoneyPostList.

Definition at line 289 of file honey_postlist.cc.

References LeafPostList::term.

◆ read_position_list()

PositionList * HoneyPosPostList::read_position_list ( )
virtual

Read the position list for the term in the current document and return a pointer to it (owned by the PostList).

The default implementation throws Xapian::UnimplementedError.

Reimplemented from Xapian::Internal::PostList.

Definition at line 279 of file honey_postlist.cc.

References HoneyPostList::get_docid(), position_list, HoneyRePositionList::read_data(), and LeafPostList::term.

Member Data Documentation

◆ position_list

HoneyRePositionList HoneyPosPostList::position_list
private

PositionList object to reuse for OP_NEAR and OP_PHRASE.

This saves the overhead of creating objects for every document considered.

Definition at line 228 of file honey_postlist.h.

Referenced by read_position_list().


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