ExactPhrasePostList Class Reference

Postlist which matches an exact phrase using positional information. More...

#include <exactphrasepostlist.h>

Inheritance diagram for ExactPhrasePostList:

Inheritance graph
[legend]
Collaboration diagram for ExactPhrasePostList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ExactPhrasePostList (PostList *source_, const std::vector< PostList * > &terms_)
 ~ExactPhrasePostList ()
Xapian::termcount get_wdf () const
 Return the wdf for the document at the current position.
Xapian::doccount get_termfreq_est () const
 Get an estimate of the number of documents indexed by this term.
std::string get_description () const
 Return a string description of this object.

Private Member Functions

void start_position_list (unsigned i)
 Start reading from the i-th position list.
bool test_doc ()
 Test if the current document contains the terms as an exact phrase.

Private Attributes

std::vector< PostList * > terms
PositionList ** poslists
unsigned * order

Detailed Description

Postlist which matches an exact phrase using positional information.

ExactPhrasePostList 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 at adjacent term positions.

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

Definition at line 39 of file exactphrasepostlist.h.


Constructor & Destructor Documentation

ExactPhrasePostList::ExactPhrasePostList ( PostList source_,
const std::vector< PostList * > &  terms_ 
)

ExactPhrasePostList::~ExactPhrasePostList (  ) 

Definition at line 47 of file exactphrasepostlist.cc.

References order, and poslists.


Member Function Documentation

void ExactPhrasePostList::start_position_list ( unsigned  i  )  [private]

Start reading from the i-th position list.

Definition at line 54 of file exactphrasepostlist.cc.

References Xapian::PositionIterator::Internal::index, order, poslists, and terms.

Referenced by test_doc().

bool ExactPhrasePostList::test_doc (  )  [private, virtual]

Test if the current document contains the terms as an exact phrase.

Implements SelectPostList.

Definition at line 73 of file exactphrasepostlist.cc.

References SelectPostList::at_end(), DEBUGCALL, Xapian::PositionIterator::Internal::get_position(), Xapian::PositionIterator::Internal::index, Xapian::PositionIterator::Internal::next(), order, poslists, RETURN, Xapian::PositionIterator::Internal::skip_to(), start_position_list(), and terms.

Xapian::termcount ExactPhrasePostList::get_wdf (  )  const [virtual]

Return the wdf for the document at the current position.

The default implementation throws Xapian::UnimplementedError.

Reimplemented from Xapian::PostingIterator::Internal.

Definition at line 128 of file exactphrasepostlist.cc.

References terms.

Xapian::doccount ExactPhrasePostList::get_termfreq_est (  )  const [virtual]

Get an estimate of the number of documents indexed by this term.

It should always be true that: get_termfreq_min() <= get_termfreq_est() <= get_termfreq_max()

Implements Xapian::PostingIterator::Internal.

Definition at line 149 of file exactphrasepostlist.cc.

References Xapian::PostingIterator::Internal::get_termfreq_est(), and SelectPostList::source.

string ExactPhrasePostList::get_description (  )  const [virtual]

Return a string description of this object.

Reimplemented from SelectPostList.

Definition at line 158 of file exactphrasepostlist.cc.

References Xapian::PostingIterator::Internal::get_description(), and SelectPostList::source.


Member Data Documentation

std::vector<PostList*> ExactPhrasePostList::terms [private]

Definition at line 40 of file exactphrasepostlist.h.

Referenced by get_wdf(), TermCompare::operator()(), start_position_list(), and test_doc().

PositionList** ExactPhrasePostList::poslists [private]

Definition at line 42 of file exactphrasepostlist.h.

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

unsigned* ExactPhrasePostList::order [private]

Definition at line 44 of file exactphrasepostlist.h.

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


The documentation for this class was generated from the following files:
Documentation for Xapian (version 1.0.10).
Generated on 24 Dec 2008 by Doxygen 1.5.2.