xapian-core
1.4.27
|
Class to hold statistics for a given collection. More...
#include <weightinternal.h>
Public Member Functions | |
Internal () | |
Internal & | operator+= (const Internal &inc) |
Add in the supplied statistics from a sub-database. More... | |
void | merge (const Weight::Internal &o) |
void | set_query (const Xapian::Query &query_) |
void | accumulate_stats (const Xapian::Database::Internal &sub_db, const Xapian::RSet &rset) |
Accumulate the rtermfreqs for terms in the query. More... | |
bool | get_stats (const std::string &term, Xapian::doccount &termfreq, Xapian::doccount &reltermfreq, Xapian::termcount &collfreq) const |
Get the frequencies for the given term. More... | |
bool | get_stats (const std::string &term, Xapian::doccount &termfreq) const |
Get just the termfreq. More... | |
bool | get_termweight (const std::string &term, double &termweight) const |
Get the termweight. More... | |
void | get_max_termweight (double &min_tw, double &max_tw) |
Get the minimum and maximum termweights. More... | |
void | set_max_part (const std::string &term, double max_part) |
Set max_part for a term. More... | |
Xapian::doclength | get_average_length () const |
void | set_bounds_from_db (const Xapian::Database &db_) |
Set the "bounds" stats from Database db. More... | |
std::string | get_description () const |
Return a std::string describing this object. More... | |
Public Attributes | |
Xapian::totallength | total_length = 0 |
Total length of all documents in the collection. More... | |
Xapian::doccount | collection_size = 0 |
Number of documents in the collection. More... | |
Xapian::doccount | rset_size = 0 |
Number of relevant documents in the collection. More... | |
bool | have_max_part = false |
Has max_part been set for any term? More... | |
Xapian::Database | db |
Database to get the bounds on doclength and wdf from. More... | |
Xapian::Query | query |
The query. More... | |
std::map< std::string, TermFreqs > | termfreqs |
Map of term frequencies and relevant term frequencies for the collection. More... | |
Class to hold statistics for a given collection.
Definition at line 74 of file weightinternal.h.
|
inline |
Definition at line 112 of file weightinternal.h.
References TermFreqs::operator+=().
void Xapian::Weight::Internal::accumulate_stats | ( | const Xapian::Database::Internal & | sub_db, |
const Xapian::RSet & | rset | ||
) |
Accumulate the rtermfreqs for terms in the query.
Definition at line 74 of file weightinternal.cc.
References Assert, TermFreqs::collfreq, Xapian::Database::Internal::get_doccount(), Xapian::Database::Internal::get_freqs(), Xapian::Database::Internal::get_total_length(), Xapian::Query::get_unique_terms_begin(), Xapian::RSet::internal, Xapian::Database::Internal::open_term_list(), query(), Xapian::RSet::size(), Xapian::TermIterator::Internal::skip_to(), and TermFreqs::termfreq.
Referenced by LocalSubMatch::prepare_match().
|
inline |
Definition at line 231 of file weightinternal.h.
References rare.
Referenced by Xapian::Weight::init_().
string Xapian::Weight::Internal::get_description | ( | ) | const |
Return a std::string describing this object.
Definition at line 131 of file weightinternal.cc.
References Xapian::Internal::str().
|
inline |
Get the minimum and maximum termweights.
Used by the snippet code.
Definition at line 202 of file weightinternal.h.
References TermFreqs::max_part, and rare.
|
inline |
Get the frequencies for the given term.
termfreq is "n_t", the number of documents in the collection indexed by the given term.
reltermfreq is "r_t", the number of relevant documents in the collection indexed by the given term.
collfreq is the total number of occurrences of the term in all documents.
Definition at line 143 of file weightinternal.h.
Referenced by Xapian::Weight::init_().
|
inline |
Get just the termfreq.
Definition at line 172 of file weightinternal.h.
|
inline |
Get the termweight.
Definition at line 180 of file weightinternal.h.
Referenced by Xapian::check_term().
void Xapian::Weight::Internal::merge | ( | const Weight::Internal & | o | ) |
Definition at line 121 of file weightinternal.cc.
References have_max_part, and termfreqs.
Referenced by RemoteSubMatch::get_postlist().
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 55 of file weightinternal.cc.
References Assert, collection_size, rset_size, termfreqs, and total_length.
|
inline |
Set the "bounds" stats from Database db.
Definition at line 240 of file weightinternal.h.
References Assert, and TermFreqs::get_description().
Referenced by MultiMatch::MultiMatch().
|
inline |
|
inline |
Definition at line 123 of file weightinternal.h.
References AssertEq, and sub_db().
Referenced by MultiMatch::MultiMatch().
Xapian::doccount Xapian::Weight::Internal::collection_size = 0 |
Number of documents in the collection.
Definition at line 91 of file weightinternal.h.
Referenced by AndNotPostList::get_termfreq_est_using_stats(), OrPostList::get_termfreq_est_using_stats(), ValueRangePostList::get_termfreq_est_using_stats(), MultiXorPostList::get_termfreq_est_using_stats(), LeafPostList::get_termfreq_est_using_stats(), MultiAndPostList::get_termfreq_est_using_stats(), Xapian::Weight::init_(), operator+=(), serialise_stats(), and unserialise_stats().
Xapian::Database Xapian::Weight::Internal::db |
Database to get the bounds on doclength and wdf from.
Definition at line 103 of file weightinternal.h.
Referenced by Xapian::Weight::init_().
bool Xapian::Weight::Internal::have_max_part = false |
Has max_part been set for any term?
If not, we can avoid having to serialise max_part.
Definition at line 100 of file weightinternal.h.
Referenced by merge(), serialise_stats(), and unserialise_stats().
Xapian::Query Xapian::Weight::Internal::query |
The query.
Definition at line 106 of file weightinternal.h.
Xapian::doccount Xapian::Weight::Internal::rset_size = 0 |
Number of relevant documents in the collection.
Definition at line 94 of file weightinternal.h.
Referenced by AndNotPostList::get_termfreq_est_using_stats(), OrPostList::get_termfreq_est_using_stats(), ValueRangePostList::get_termfreq_est_using_stats(), MultiXorPostList::get_termfreq_est_using_stats(), LeafPostList::get_termfreq_est_using_stats(), MultiAndPostList::get_termfreq_est_using_stats(), Xapian::Weight::init_(), operator+=(), serialise_stats(), and unserialise_stats().
std::map<std::string, TermFreqs> Xapian::Weight::Internal::termfreqs |
Map of term frequencies and relevant term frequencies for the collection.
Definition at line 110 of file weightinternal.h.
Referenced by LeafPostList::get_termfreq_est_using_stats(), merge(), operator+=(), LeafPostList::resolve_lazy_termweight(), serialise_stats(), and unserialise_stats().
Xapian::totallength Xapian::Weight::Internal::total_length = 0 |
Total length of all documents in the collection.
Definition at line 88 of file weightinternal.h.
Referenced by AndNotPostList::get_termfreq_est_using_stats(), OrPostList::get_termfreq_est_using_stats(), ValueRangePostList::get_termfreq_est_using_stats(), MultiXorPostList::get_termfreq_est_using_stats(), LeafPostList::get_termfreq_est_using_stats(), MultiAndPostList::get_termfreq_est_using_stats(), operator+=(), serialise_stats(), and unserialise_stats().