41 LOGCALL_VOID(MATCH,
"Weight::init_", stats | query_length);
44 if (stats_needed & AVERAGE_LENGTH)
46 if (stats_needed & DOC_LENGTH_MAX)
48 if (stats_needed & DOC_LENGTH_MIN)
54 query_length_ = query_length;
64 LOGCALL_VOID(MATCH,
"Weight::init_", stats | query_length | term | wqf | factor | postlist_void);
67 if (stats_needed & AVERAGE_LENGTH)
69 if (stats_needed & DOC_LENGTH_MAX)
71 if (stats_needed & DOC_LENGTH_MIN)
73 if (stats_needed & WDF_MAX) {
74 if (
usual(postlist_void !=
nullptr)) {
75 auto postlist =
static_cast<LeafPostList*
>(postlist_void);
81 if (stats_needed & (TERMFREQ | RELTERMFREQ | COLLECTION_FREQ)) {
83 termfreq_, reltermfreq_, collectionfreq_);
87 query_length_ = query_length;
96 init_(stats, query_length, term, wqf, factor,
nullptr);
104 LOGCALL_VOID(MATCH,
"Weight::init_", stats | query_length | factor | termfreq | reltermfreq | collection_freq);
108 if (stats_needed & AVERAGE_LENGTH)
110 if (stats_needed & (DOC_LENGTH_MAX | WDF_MAX)) {
119 wdf_upper_bound_ = doclength_upper_bound_;
121 if (stats_needed & DOC_LENGTH_MIN)
124 termfreq_ = termfreq;
125 reltermfreq_ = reltermfreq;
126 query_length_ = query_length;
127 collectionfreq_ = collection_freq;
132 Weight::~Weight() { }
141 Weight::serialise()
const 147 Weight::unserialise(
const string &)
const The Xapian namespace contains public interfaces for the Xapian library.
virtual Xapian::termcount get_wdf_upper_bound() const =0
Xapian::Database db
Database to get the bounds on doclength and wdf from.
Xapian::termcount get_doclength_lower_bound() const
Get a lower bound on the length of a document in this DB.
bool get_stats(const std::string &term, Xapian::doccount &termfreq, Xapian::doccount &reltermfreq, Xapian::termcount &collfreq) const
Get the frequencies for the given term.
#define LOGCALL_VOID(CATEGORY, FUNC, PARAMS)
Abstract base class for leaf postlists.
Abstract base class for leaf postlists.
Xapian::doccount collection_size
Number of documents in the collection.
Xapian::doccount rset_size
Number of relevant documents in the collection.
Hierarchy of classes which Xapian can throw as exceptions.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
Xapian::termcount get_doclength_upper_bound() const
Get an upper bound on the length of a document in this DB.
Xapian::Weight::Internal class, holding database and term statistics.
Class to hold statistics for a given collection.
Xapian::doclength get_average_length() const
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Various assertion macros.
UnimplementedError indicates an attempt to use an unimplemented feature.
Abstract base class for weighting schemes.
Xapian::termcount get_wdf_upper_bound(const std::string &term) const
Get an upper bound on the wdf of term term.