LeafPostList Class Reference

Abstract base class for leaf postlists. More...

#include <leafpostlist.h>

Inheritance diagram for LeafPostList:

Inheritance graph
[legend]
Collaboration diagram for LeafPostList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~LeafPostList ()
void set_termweight (const Xapian::Weight *weight_)
 Set the weighting scheme to use during matching.
virtual Xapian::doccount get_termfreq () const=0
 Return the exact term frequency.
Xapian::doccount get_termfreq_min () const
 Get a lower bound on the number of documents indexed by this term.
Xapian::doccount get_termfreq_max () const
 Get an upper bound on the number of documents indexed by this term.
Xapian::doccount get_termfreq_est () const
 Get an estimate of the number of documents indexed by this term.
Xapian::weight get_maxweight () const
 Return an upper bound on what get_weight() can return.
Xapian::weight get_weight () const
 Return the weight contribution for the current position.
Xapian::weight recalc_maxweight ()
 Recalculate the upper bound on what get_weight() can return.

Protected Member Functions

 LeafPostList ()
 Only constructable as a base class for derived classes.

Protected Attributes

const Xapian::Weightweight
bool need_doclength

Private Member Functions

void operator= (const LeafPostList &)
 Don't allow assignment.
 LeafPostList (const LeafPostList &)
 Don't allow copying.

Detailed Description

Abstract base class for leaf postlists.

This class provides the following features in addition to the PostList class:

Definition at line 35 of file leafpostlist.h.


Constructor & Destructor Documentation

LeafPostList::LeafPostList ( const LeafPostList  )  [private]

Don't allow copying.

LeafPostList::LeafPostList (  )  [inline, protected]

Only constructable as a base class for derived classes.

Definition at line 47 of file leafpostlist.h.

LeafPostList::~LeafPostList (  ) 

Definition at line 28 of file leafpostlist.cc.

References weight.


Member Function Documentation

void LeafPostList::operator= ( const LeafPostList  )  [private]

Don't allow assignment.

void LeafPostList::set_termweight ( const Xapian::Weight weight_  ) 

Set the weighting scheme to use during matching.

If this isn't called, get_weight() and get_maxweight() will both return 0.

You should not call this more than once on a particular object.

Parameters:
weight_ The weighting object to use. Must not be NULL.

Definition at line 52 of file leafpostlist.cc.

References Assert, Xapian::Weight::get_sumpart_needs_doclength(), need_doclength, and weight.

Referenced by LocalSubMatch::postlist_from_op_leaf_query().

virtual Xapian::doccount LeafPostList::get_termfreq (  )  const [pure virtual]

Return the exact term frequency.

Leaf postlists have an exact termfreq, which get_termfreq_min(), get_termfreq_max(), and get_termfreq_est() all report.

Implemented in ContiguousAllDocsPostList, FlintAllDocsPostList, FlintModifiedPostList, FlintPostList, InMemoryPostList, InMemoryAllDocsPostList, MultiPostList, QuartzAllDocsPostList, QuartzPostList, NetworkPostList, and EmptyPostList.

Referenced by get_termfreq_est(), get_termfreq_max(), and get_termfreq_min().

Xapian::doccount LeafPostList::get_termfreq_min (  )  const [virtual]

Get a lower bound on the number of documents indexed by this term.

Implements Xapian::PostingIterator::Internal.

Definition at line 34 of file leafpostlist.cc.

References get_termfreq().

Xapian::doccount LeafPostList::get_termfreq_max (  )  const [virtual]

Get an upper bound on the number of documents indexed by this term.

Implements Xapian::PostingIterator::Internal.

Definition at line 40 of file leafpostlist.cc.

References get_termfreq().

Xapian::doccount LeafPostList::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 46 of file leafpostlist.cc.

References get_termfreq().

Xapian::weight LeafPostList::get_maxweight (  )  const [virtual]

Return an upper bound on what get_weight() can return.

Implements Xapian::PostingIterator::Internal.

Reimplemented in EmptyPostList.

Definition at line 61 of file leafpostlist.cc.

References Xapian::Weight::get_maxpart(), and weight.

Referenced by recalc_maxweight().

Xapian::weight LeafPostList::get_weight (  )  const [virtual]

Return the weight contribution for the current position.

Implements Xapian::PostingIterator::Internal.

Reimplemented in EmptyPostList.

Definition at line 67 of file leafpostlist.cc.

References Xapian::PostingIterator::Internal::get_doclength(), Xapian::Weight::get_sumpart(), Xapian::PostingIterator::Internal::get_wdf(), need_doclength, and weight.

Xapian::weight LeafPostList::recalc_maxweight (  )  [virtual]

Recalculate the upper bound on what get_weight() can return.

If the tree has pruned, get_maxweight() may use cached values. Calling this method instead forces a full recalculation.

Implements Xapian::PostingIterator::Internal.

Definition at line 78 of file leafpostlist.cc.

References get_maxweight().


Member Data Documentation

const Xapian::Weight* LeafPostList::weight [protected]

Definition at line 43 of file leafpostlist.h.

Referenced by get_maxweight(), get_weight(), set_termweight(), and ~LeafPostList().

bool LeafPostList::need_doclength [protected]

Definition at line 44 of file leafpostlist.h.

Referenced by get_weight(), and set_termweight().


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.