xapian-core
1.4.26
|
Postlist which matches a phrase using positional information. More...
#include <phrasepostlist.h>
Public Member Functions | |
PhrasePostList (PostList *source_, Xapian::termpos window_, const std::vector< PostList *>::const_iterator &terms_begin, const std::vector< PostList *>::const_iterator &terms_end) | |
~PhrasePostList () | |
Xapian::termcount | get_wdf () const |
Return the wdf for the document at the current position. More... | |
Xapian::doccount | get_termfreq_est () const |
Get an estimate of the number of documents indexed by this term. More... | |
TermFreqs | get_termfreq_est_using_stats (const Xapian::Weight::Internal &stats) const |
Get an estimate for the termfreq and reltermfreq, given the stats. More... | |
std::string | get_description () const |
Return a string description of this object. More... | |
Public Member Functions inherited from SelectPostList | |
PostList * | next (double w_min) |
Advance the current position to the next document in the postlist. More... | |
PostList * | skip_to (Xapian::docid did, double w_min) |
Skip forward to the specified docid. More... | |
PostList * | check (Xapian::docid did, double w_min, bool &valid) |
Check if the specified docid occurs in this postlist. More... | |
Xapian::doccount | get_termfreq_max () const |
Get an upper bound on the number of documents indexed by this term. More... | |
Xapian::doccount | get_termfreq_min () const |
Get a lower bound on the number of documents indexed by this term. More... | |
double | get_maxweight () const |
Return an upper bound on what get_weight() can return. More... | |
Xapian::docid | get_docid () const |
Return the current docid. More... | |
double | get_weight () const |
Return the weight contribution for the current position. More... | |
Xapian::termcount | get_doclength () const |
Return the length of current document. More... | |
Xapian::termcount | get_unique_terms () const |
Return the number of unique terms in the current document. More... | |
double | recalc_maxweight () |
Recalculate the upper bound on what get_weight() can return. More... | |
PositionList * | read_position_list () |
Read the position list for the term in the current document and return a pointer to it (owned by the PostList). More... | |
PositionList * | open_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... | |
bool | at_end () const |
Return true if the current position is past the last entry in this list. More... | |
Xapian::termcount | count_matching_subqs () const |
Count the number of leaf subqueries which match at the current position. More... | |
std::string | get_description () const |
Return a string description of this object. More... | |
SelectPostList (PostList *source_) | |
~SelectPostList () | |
Public Member Functions inherited from Xapian::PostingIterator::Internal | |
virtual | ~Internal () |
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... | |
virtual const std::string * | get_sort_key () const |
virtual const std::string * | get_collapse_key () const |
If the collapse key is already known, return it. More... | |
Internal * | next () |
Advance the current position to the next document in the postlist. More... | |
Internal * | skip_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... | |
Public Member Functions inherited from Xapian::Internal::intrusive_base | |
intrusive_base () | |
Construct with no references. 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 | |
Public Attributes inherited from Xapian::Internal::intrusive_base | |
unsigned | _refs |
Reference count. More... | |
Protected Member Functions inherited from Xapian::PostingIterator::Internal | |
Internal () | |
Only constructable as a base class for derived classes. More... | |
Protected Attributes inherited from SelectPostList | |
PostList * | source |
double | wt |
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 38 of file phrasepostlist.h.
PhrasePostList::PhrasePostList | ( | PostList * | source_, |
Xapian::termpos | window_, | ||
const std::vector< PostList *>::const_iterator & | terms_begin, | ||
const std::vector< PostList *>::const_iterator & | terms_end | ||
) |
Definition at line 35 of file phrasepostlist.cc.
PhrasePostList::~PhrasePostList | ( | ) |
Definition at line 46 of file phrasepostlist.cc.
References poslists.
|
virtual |
Return a string description of this object.
Implements Xapian::PostingIterator::Internal.
Definition at line 128 of file phrasepostlist.cc.
References Xapian::PostingIterator::Internal::get_description(), SelectPostList::source, Xapian::Internal::str(), and window.
|
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 105 of file phrasepostlist.cc.
References Xapian::PostingIterator::Internal::get_termfreq_est(), and SelectPostList::source.
|
virtual |
Get an estimate for the termfreq and reltermfreq, given the stats.
The frequencies may be for a combination of databases, or for just the relevant documents, so the results need not lie in the bounds given by get_termfreq_min() and get_termfreq_max().
Reimplemented from Xapian::PostingIterator::Internal.
Definition at line 114 of file phrasepostlist.cc.
References Xapian::PostingIterator::Internal::get_termfreq_est_using_stats(), LOGCALL, RETURN, SelectPostList::source, and TermFreqs::termfreq.
|
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 90 of file phrasepostlist.cc.
References terms.
|
private |
Start reading from the i-th position list.
Definition at line 52 of file phrasepostlist.cc.
References poslists, and terms.
Referenced by test_doc().
|
privatevirtual |
Test if the current document contains the terms as a phrase.
Implements SelectPostList.
Definition at line 58 of file phrasepostlist.cc.
References Xapian::PositionIterator::Internal::get_position(), LOGCALL, Xapian::PostingIterator::Internal::next(), poslists, RETURN, SelectPostList::skip_to(), start_position_list(), terms, and window.
|
private |
Definition at line 43 of file phrasepostlist.h.
Referenced by PhrasePostList(), start_position_list(), test_doc(), and ~PhrasePostList().
|
private |
Definition at line 41 of file phrasepostlist.h.
Referenced by get_wdf(), PhrasePostList(), start_position_list(), and test_doc().
|
private |
Definition at line 39 of file phrasepostlist.h.
Referenced by get_description(), and test_doc().