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

Postlist which matches a phrase using positional information. More...

#include <phrasepostlist.h>

+ Inheritance diagram for PhrasePostList:
+ Collaboration diagram for PhrasePostList:

Public Member Functions

 PhrasePostList (PostList *source_, EstimateOp *estimate_op_, Xapian::termpos window_, const std::vector< PostList * >::const_iterator &terms_begin, const std::vector< PostList * >::const_iterator &terms_end, PostListTree *pltree_)
 
 ~PhrasePostList ()
 
Xapian::termcount get_wdf () const
 Return the wdf for the document at the current position. More...
 
std::string get_description () const
 Return a string description of this object. More...
 
- Public Member Functions inherited from SelectPostList
 SelectPostList (PostList *pl_, EstimateOp *estimate_op_, PostListTree *pltree_)
 
 ~SelectPostList ()
 
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...
 
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...
 
PostListcheck (Xapian::docid did, double w_min, bool &valid)
 Check if the specified docid occurs in this postlist. More...
 
- Public Member Functions inherited from WrapperPostList
 WrapperPostList (PostList *pl_)
 
 ~WrapperPostList ()
 
Xapian::docid get_docid () const
 Return the current docid. 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...
 
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...
 
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...
 
Xapian::termcount get_wdf () const
 Return the wdf for the document at the current position. More...
 
Xapian::termcount count_matching_subqs () const
 Count the number of leaf subqueries which match at the current position. 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 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 ()
 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 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 start_position_list (unsigned i)
 Start reading from the i-th position list. More...
 
bool test_doc ()
 Test if the current document contains the terms as a phrase. More...
 

Private Attributes

Xapian::termpos window
 
std::vector< PostList * > terms
 
PositionList ** poslists
 

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 SelectPostList
Xapian::doccount accepted = 0
 Number of times test_doc() returned true. More...
 
Xapian::doccount rejected = 0
 Number of times test_doc() returned false. More...
 
EstimateOpestimate_op
 Object to report accepted/rejected counts to. More...
 
- Protected Attributes inherited from WrapperPostList
PostListpl
 
- Protected Attributes inherited from Xapian::Internal::PostList
Xapian::doccount termfreq
 Estimate of the number of documents this PostList will return. More...
 

Detailed Description

Postlist which matches a phrase using positional information.

PhrasePostList only returns a posting for documents contains all the terms (this part is implemented using an AndPostList) and additionally the terms occur somewhere in the document in the order given and within a specified number of term positions.

The weight of a posting is the sum of the weights of the sub-postings (just like an AndPostList).

Definition at line 41 of file phrasepostlist.h.

Constructor & Destructor Documentation

◆ PhrasePostList()

PhrasePostList::PhrasePostList ( PostList source_,
EstimateOp estimate_op_,
Xapian::termpos  window_,
const std::vector< PostList * >::const_iterator &  terms_begin,
const std::vector< PostList * >::const_iterator &  terms_end,
PostListTree pltree_ 
)

◆ ~PhrasePostList()

PhrasePostList::~PhrasePostList ( )

Definition at line 55 of file phrasepostlist.cc.

References poslists.

Member Function Documentation

◆ get_description()

string PhrasePostList::get_description ( ) const
virtual

Return a string description of this object.

Implements Xapian::Internal::PostList.

Definition at line 122 of file phrasepostlist.cc.

References Xapian::Internal::PostList::get_description(), WrapperPostList::pl, Xapian::Internal::str(), and window.

◆ get_wdf()

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

Return the wdf for the document at the current position.

The default implementation throws Xapian::UnimplementedError.

Reimplemented from Xapian::Internal::PostList.

Definition at line 107 of file phrasepostlist.cc.

References terms.

◆ start_position_list()

void PhrasePostList::start_position_list ( unsigned  i)
private

Start reading from the i-th position list.

Definition at line 61 of file phrasepostlist.cc.

References poslists, and terms.

Referenced by test_doc().

◆ test_doc()

bool PhrasePostList::test_doc ( )
privatevirtual

Member Data Documentation

◆ poslists

PositionList** PhrasePostList::poslists
private

Definition at line 46 of file phrasepostlist.h.

Referenced by PhrasePostList(), start_position_list(), test_doc(), and ~PhrasePostList().

◆ terms

std::vector<PostList*> PhrasePostList::terms
private

Definition at line 44 of file phrasepostlist.h.

Referenced by get_wdf(), PhrasePostList(), start_position_list(), and test_doc().

◆ window

Xapian::termpos PhrasePostList::window
private

Definition at line 42 of file phrasepostlist.h.

Referenced by get_description(), and test_doc().


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