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.
TermFreqs get_termfreq_est_using_stats (const Xapian::Weight::Internal &stats) const
 Get an estimate for the termfreq and reltermfreq, given the stats.
Xapian::termcount count_matching_subqs () const
 Count the number of leaf subqueries which match at the current position.

Protected Member Functions

 LeafPostList (const std::string &term_)
 Only constructable as a base class for derived classes.

Protected Attributes

const Xapian::Weightweight
bool need_doclength
std::string term
 The term name for this postlist (empty for an alldocs postlist).

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 38 of file leafpostlist.h.


Constructor & Destructor Documentation

LeafPostList::LeafPostList ( const LeafPostList  )  [private]

Don't allow copying.

LeafPostList::LeafPostList ( const std::string &  term_  )  [inline, protected]

Only constructable as a base class for derived classes.

Definition at line 54 of file leafpostlist.h.

LeafPostList::~LeafPostList (  ) 

Definition at line 32 of file leafpostlist.cc.

References weight.


Member Function Documentation

Xapian::termcount LeafPostList::count_matching_subqs (  )  const [virtual]

Count the number of leaf subqueries which match at the current position.

Reimplemented from Xapian::PostingIterator::Internal.

Definition at line 101 of file leafpostlist.cc.

References weight.

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

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

Implements Xapian::PostingIterator::Internal.

Definition at line 65 of file leafpostlist.cc.

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

Referenced by recalc_maxweight().

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

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 50 of file leafpostlist.cc.

References get_termfreq().

TermFreqs LeafPostList::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 88 of file leafpostlist.cc.

References Assert, Xapian::Weight::Internal::collection_size, LOGCALL, RETURN, Xapian::Weight::Internal::rset_size, term, and Xapian::Weight::Internal::termfreqs.

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 44 of file leafpostlist.cc.

References get_termfreq().

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 38 of file leafpostlist.cc.

References get_termfreq().

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

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

Don't allow assignment.

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.

Note that this method may be called after the postlist has reached the end. In this situation, the method should return 0.

Implements Xapian::PostingIterator::Internal.

Definition at line 82 of file leafpostlist.cc.

References get_maxweight().

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 56 of file leafpostlist.cc.

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

Referenced by LocalSubMatch::postlist_from_op_leaf_query().


Member Data Documentation

bool LeafPostList::need_doclength [protected]

Definition at line 48 of file leafpostlist.h.

Referenced by get_weight(), and set_termweight().

std::string LeafPostList::term [protected]


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.