NearPostList Class Reference

a postlist comprising several postlists NEARed together. More...

#include <phrasepostlist.h>

Inheritance diagram for NearPostList:

Inheritance graph
[legend]
Collaboration diagram for NearPostList:

Collaboration graph
[legend]

List of all members.

Public Member Functions

std::string get_description () const
 Return a string description of this object.
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.
TermFreqs get_termfreq_est_using_stats (const Xapian::Weight::Internal &stats) const
 Get an estimate for the termfreq and reltermfreq, given the stats.
 NearPostList (PostList *source_, Xapian::termpos window_, std::vector< PostList * >::const_iterator &terms_begin_, std::vector< PostList * >::const_iterator &terms_end_)

Private Member Functions

bool test_doc ()
 Check if terms occur sufficiently close together in the current doc.
bool do_test (std::vector< PositionList * > &plists, Xapian::termcount i, Xapian::termcount min, Xapian::termcount max)

Private Attributes

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


Detailed Description

a postlist comprising several postlists NEARed together.

This postlist returns a posting if and only if it is in all of the sub-postlists and all the terms occur within a specified distance of each other somewhere in the document. The weight for a posting is the sum of the weights of the sub-postings.

Definition at line 39 of file phrasepostlist.h.


Constructor & Destructor Documentation

NearPostList::NearPostList ( PostList source_,
Xapian::termpos  window_,
std::vector< PostList * >::const_iterator &  terms_begin_,
std::vector< PostList * >::const_iterator &  terms_end_ 
) [inline]

Definition at line 60 of file phrasepostlist.h.

References window.


Member Function Documentation

bool NearPostList::do_test ( std::vector< PositionList * > &  plists,
Xapian::termcount  i,
Xapian::termcount  min,
Xapian::termcount  max 
) [private]

Definition at line 76 of file phrasepostlist.cc.

References SelectPostList::at_end(), SelectPostList::get_docid(), LOGCALL, LOGLINE, RETURN, and window.

Referenced by test_doc().

std::string NearPostList::get_description (  )  const [virtual]

Return a string description of this object.

Reimplemented from SelectPostList.

Definition at line 166 of file phrasepostlist.cc.

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

Xapian::doccount NearPostList::get_termfreq_est (  )  const [inline, 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 51 of file phrasepostlist.h.

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

TermFreqs NearPostList::get_termfreq_est_using_stats ( const Xapian::Weight::Internal stats  )  const [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 154 of file phrasepostlist.cc.

References Xapian::PostingIterator::Internal::get_termfreq_est_using_stats(), LOGCALL, RETURN, and SelectPostList::source.

Xapian::termcount NearPostList::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 100 of file phrasepostlist.cc.

References terms.

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

Check if terms occur sufficiently close together in the current doc.

Implements SelectPostList.

Definition at line 50 of file phrasepostlist.cc.

References SelectPostList::at_end(), do_test(), LOGCALL, RETURN, and terms.


Member Data Documentation

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

Definition at line 42 of file phrasepostlist.h.

Referenced by get_wdf(), and test_doc().

Definition at line 41 of file phrasepostlist.h.

Referenced by do_test(), get_description(), and NearPostList().


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

Documentation for Xapian (version 1.2.13).
Generated on 9 Jan 2013 by Doxygen 1.5.9.