Xapian::Weight::Internal Class Reference

Class to hold statistics for a given collection. More...

#include <weightinternal.h>

Collaboration diagram for Xapian::Weight::Internal:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Internal ()
Internaloperator+= (const Internal &inc)
 Add in the supplied statistics from a sub-database.
void mark_wanted_terms (const Xapian::Query::Internal &query)
 Mark the terms we need to collate stats for.
void accumulate_stats (const Xapian::Database::Internal &sub_db, const Xapian::RSet &rset)
 Accumulate the rtermfreqs for terms marked by mark_wanted_terms().
Xapian::doccount get_termfreq (const std::string &term) const
 Get the term-frequency of the given term.
Xapian::doccount get_reltermfreq (const std::string &term) const
 Get the relevant term-frequency for the given term.
Xapian::doclength get_average_length () const
void set_bounds_from_db (const Xapian::Database &db_)
 Set the "bounds" stats from Database db.
std::string get_description () const
 Return a std::string describing this object.

Public Attributes

totlen_t total_length
 Total length of all documents in the collection.
Xapian::doccount collection_size
 Number of documents in the collection.
Xapian::doccount rset_size
 Number of relevant documents in the collection.
Xapian::Database db
 Database to get the bounds on doclength and wdf from.
std::map< std::string, TermFreqstermfreqs
 Map of term frequencies and relevant term frequencies for the collection.


Detailed Description

Class to hold statistics for a given collection.

Definition at line 59 of file weightinternal.h.


Constructor & Destructor Documentation

Xapian::Weight::Internal::Internal (  )  [inline]

Definition at line 77 of file weightinternal.h.


Member Function Documentation

void Xapian::Weight::Internal::accumulate_stats ( const Xapian::Database::Internal sub_db,
const Xapian::RSet rset 
)

Xapian::doclength Xapian::Weight::Internal::get_average_length (  )  const [inline]

Definition at line 112 of file weightinternal.h.

References collection_size, rare, and total_length.

Referenced by Xapian::Weight::init_().

string Xapian::Weight::Internal::get_description (  )  const

Return a std::string describing this object.

Definition at line 124 of file weightinternal.cc.

References collection_size, rset_size, Xapian::Internal::str(), and total_length.

Xapian::doccount Xapian::Weight::Internal::get_reltermfreq ( const std::string &  term  )  const

Get the relevant term-frequency for the given term.

This is "r_t", the number of relevant documents in the collection indexed by the given term.

Definition at line 113 of file weightinternal.cc.

References Assert, and termfreqs.

Referenced by Xapian::Weight::init_().

Xapian::doccount Xapian::Weight::Internal::get_termfreq ( const std::string &  term  )  const

Get the term-frequency of the given term.

This is "n_t", the number of documents in the collection indexed by the given term.

Definition at line 66 of file weightinternal.cc.

References Assert, and termfreqs.

Referenced by Xapian::Weight::init_(), and LocalSubMatch::postlist_from_op_leaf_query().

void Xapian::Weight::Internal::mark_wanted_terms ( const Xapian::Query::Internal query  )  [inline]

Mark the terms we need to collate stats for.

Definition at line 87 of file weightinternal.h.

References Xapian::Query::Internal::get_terms(), and termfreqs.

Referenced by MultiMatch::MultiMatch().

Weight::Internal & Xapian::Weight::Internal::operator+= ( const Internal inc  ) 

Add in the supplied statistics from a sub-database.

Used for remote databases, where we pass across a serialised stats object, unserialise it, and add it to our total.

Definition at line 51 of file weightinternal.cc.

References collection_size, rset_size, termfreqs, and total_length.

void Xapian::Weight::Internal::set_bounds_from_db ( const Xapian::Database db_  )  [inline]

Set the "bounds" stats from Database db.

Definition at line 118 of file weightinternal.h.

References db.

Referenced by RemoteServer::msg_query(), and MultiMatch::MultiMatch().


Member Data Documentation

Database to get the bounds on doclength and wdf from.

Definition at line 71 of file weightinternal.h.

Referenced by Xapian::Weight::init_(), and set_bounds_from_db().

Map of term frequencies and relevant term frequencies for the collection.

Definition at line 75 of file weightinternal.h.

Referenced by accumulate_stats(), get_reltermfreq(), get_termfreq(), LeafPostList::get_termfreq_est_using_stats(), mark_wanted_terms(), operator+=(), serialise_stats(), and unserialise_stats().

Total length of all documents in the collection.

Definition at line 62 of file weightinternal.h.

Referenced by accumulate_stats(), get_average_length(), get_description(), operator+=(), serialise_stats(), and unserialise_stats().


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

Documentation for Xapian (version 1.2.8).
Generated on 14 Dec 2011 by Doxygen 1.5.9.