#include <exactphrasepostlist.h>
Inheritance diagram for ExactPhrasePostList:
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 |
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.
ExactPhrasePostList::ExactPhrasePostList | ( | PostList * | source_, | |
const std::vector< PostList * > & | terms_ | |||
) |
ExactPhrasePostList::~ExactPhrasePostList | ( | ) |
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.
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().