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.
 NearPostList (PostList *source_, Xapian::termpos window_, std::vector< PostList * > terms_)

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 * >  terms_ 
) [inline]

Definition at line 57 of file phrasepostlist.h.

References terms, and window.


Member Function Documentation

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

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

Implements SelectPostList.

Definition at line 49 of file phrasepostlist.cc.

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

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

Definition at line 75 of file phrasepostlist.cc.

References SelectPostList::at_end(), DEBUGCALL, DEBUGLINE, SelectPostList::get_docid(), 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 153 of file phrasepostlist.cc.

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

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 99 of file phrasepostlist.cc.

References terms.

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.


Member Data Documentation

Xapian::termpos NearPostList::window [private]

Definition at line 41 of file phrasepostlist.h.

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

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

Definition at line 42 of file phrasepostlist.h.

Referenced by get_wdf(), NearPostList(), and test_doc().


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.