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

Class for merging PostList objects from subdatabases. More...

#include <multi_postlist.h>

+ Inheritance diagram for MultiPostList:
+ Collaboration diagram for MultiPostList:

Public Member Functions

 MultiPostList (Xapian::doccount n_shards_, PostList **postlists_)
 Constructor. More...
 
 ~MultiPostList ()
 Destructor. 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...
 
double get_weight (Xapian::termcount doclen, Xapian::termcount unique_terms, Xapian::termcount wdfdocmax) const
 Return the weight contribution for the current position. More...
 
bool at_end () const
 Return true if the current position is past the last entry in this list. More...
 
double recalc_maxweight ()
 Recalculate the upper bound on what get_weight() can return. More...
 
PositionListopen_position_list () const
 Read the position list for the term in the current document and. More...
 
PostListnext (double w_min)
 Advance the current position to the next document in the postlist. More...
 
PostListskip_to (Xapian::docid, double w_min)
 Skip forward to the specified docid. More...
 
std::string get_description () const
 Return a string description of this object. 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 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...
 
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...
 
virtual Xapian::termcount count_matching_subqs () const
 Count the number of leaf subqueries which match at the current position. More...
 
virtual void gather_position_lists (OrPositionList *orposlist)
 Gather PositionList* objects for a subtree. More...
 
virtual void get_docid_range (docid &first, docid &last) const
 Get the bounds on the range of docids this PostList can return. More...
 

Private Member Functions

void operator= (const MultiPostList &)=delete
 Don't allow assignment. More...
 
 MultiPostList (const MultiPostList &)=delete
 Don't allow copying. More...
 

Private Attributes

Xapian::doccount n_shards
 Number of PostList* entries in postlists. More...
 
PostList ** postlists
 Sub-postlists which we use as a heap. More...
 
Xapian::doccount docids_size = 0
 Number of entries in docids;. More...
 
Xapian::dociddocids = nullptr
 Heap of docids from the current positions of the postlists. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Xapian::Internal::PostList
 PostList ()
 Only constructable as a base class for derived classes. More...
 
- Protected Attributes inherited from Xapian::Internal::PostList
Xapian::doccount termfreq
 Estimate of the number of documents this PostList will return. More...
 

Detailed Description

Class for merging PostList objects from subdatabases.

Definition at line 31 of file multi_postlist.h.

Constructor & Destructor Documentation

◆ MultiPostList() [1/2]

MultiPostList::MultiPostList ( const MultiPostList )
privatedelete

Don't allow copying.

◆ MultiPostList() [2/2]

MultiPostList::MultiPostList ( Xapian::doccount  n_shards_,
PostList **  postlists_ 
)
inline

◆ ~MultiPostList()

MultiPostList::~MultiPostList ( )

Destructor.

Definition at line 35 of file multi_postlist.cc.

Member Function Documentation

◆ at_end()

bool MultiPostList::at_end ( ) const
virtual

Return true if the current position is past the last entry in this list.

Implements Xapian::Internal::PostList.

Definition at line 67 of file multi_postlist.cc.

◆ get_description()

std::string MultiPostList::get_description ( ) const
virtual

Return a string description of this object.

Implements Xapian::Internal::PostList.

Definition at line 183 of file multi_postlist.cc.

◆ get_docid()

Xapian::docid MultiPostList::get_docid ( ) const
virtual

Return the current docid.

Implements Xapian::Internal::PostList.

Definition at line 44 of file multi_postlist.cc.

◆ get_wdf()

Xapian::termcount MultiPostList::get_wdf ( ) const
virtual

Return the wdf for the document at the current position.

Reimplemented from Xapian::Internal::PostList.

Definition at line 50 of file multi_postlist.cc.

References shard_number().

◆ get_weight()

double MultiPostList::get_weight ( Xapian::termcount  doclen,
Xapian::termcount  unique_terms,
Xapian::termcount  wdfdocmax 
) const
virtual

Return the weight contribution for the current position.

Implements Xapian::Internal::PostList.

Definition at line 56 of file multi_postlist.cc.

References Assert.

◆ next()

PostList * MultiPostList::next ( double  w_min)
virtual

Advance the current position to the next document in the postlist.

The list starts before the first entry in the list, so next(), skip_to() or check() must be called before any methods which need the context of the current position.

Parameters
w_minThe minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore).
Returns
If a non-NULL pointer is returned, then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::Internal::PostList.

Definition at line 88 of file multi_postlist.cc.

References Xapian::Internal::PostList::at_end(), Xapian::Internal::PostList::get_docid(), Heap::make(), Xapian::Internal::PostList::next(), Heap::pop(), Heap::replace(), shard_number(), and unshard().

◆ open_position_list()

PositionList * MultiPostList::open_position_list ( ) const
virtual

Read the position list for the term in the current document and.

Reimplemented from Xapian::Internal::PostList.

Definition at line 82 of file multi_postlist.cc.

References shard_number().

◆ operator=()

void MultiPostList::operator= ( const MultiPostList )
privatedelete

Don't allow assignment.

◆ recalc_maxweight()

double MultiPostList::recalc_maxweight ( )
virtual

Recalculate the upper bound on what get_weight() can return.

Implements Xapian::Internal::PostList.

Definition at line 73 of file multi_postlist.cc.

References Assert.

◆ skip_to()

PostList * MultiPostList::skip_to ( Xapian::docid  did,
double  w_min 
)
virtual

Skip forward to the specified docid.

If the specified docid isn't in the list, position ourselves on the first document after it (or at_end() if no greater docids are present).

Parameters
w_minThe minimum weight contribution that is needed (this is just a hint which PostList subclasses may ignore).
Returns
If a non-NULL pointer is returned, then the caller should substitute the returned pointer for its pointer to us, and then delete us. This "pruning" can only happen for a non-leaf subclass of this class.

Implements Xapian::Internal::PostList.

Definition at line 130 of file multi_postlist.cc.

References Xapian::Internal::PostList::at_end(), Xapian::Internal::PostList::get_docid(), Heap::make(), Xapian::Internal::PostList::next(), shard_docid(), shard_number(), Xapian::Internal::PostList::skip_to(), and unshard().

Member Data Documentation

◆ docids

Xapian::docid* MultiPostList::docids = nullptr
private

Heap of docids from the current positions of the postlists.

Definition at line 48 of file multi_postlist.h.

Referenced by MultiPostList().

◆ docids_size

Xapian::doccount MultiPostList::docids_size = 0
private

Number of entries in docids;.

Definition at line 45 of file multi_postlist.h.

◆ n_shards

Xapian::doccount MultiPostList::n_shards
private

Number of PostList* entries in postlists.

Definition at line 39 of file multi_postlist.h.

Referenced by MultiPostList().

◆ postlists

PostList** MultiPostList::postlists
private

Sub-postlists which we use as a heap.

Definition at line 42 of file multi_postlist.h.

Referenced by MultiPostList().


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