37 ExpandWeight::collect_stats(
TermList * merger,
const std::string & term)
39 LOGCALL_VOID(API,
"ExpandWeight::collect_stats", merger | term);
45 collection_freq = db.get_collection_freq(term);
52 if (stats.dbsize == dbsize) {
63 if (use_exact_termfreq) {
64 LOGLINE(EXPAND,
"Had to request exact termfreq");
65 stats.termfreq = db.get_termfreq(term);
69 double tf = double(stats.termfreq) * dbsize / stats.dbsize;
70 LOGLINE(EXPAND,
"termfreq is approx " << stats.termfreq <<
" * " <<
71 dbsize <<
" / " << stats.dbsize <<
" = " <<
83 auto termfreq_upper_bound = dbsize - (rsize - stats.rtermfreq);
84 if (stats.termfreq > termfreq_upper_bound) {
85 LOGLINE(EXPAND,
"termfreq can't be more than " 86 "dbsize - (rsize + rtermfreq)");
87 stats.termfreq = termfreq_upper_bound;
The Xapian namespace contains public interfaces for the Xapian library.
#define AssertRel(A, REL, B)
#define LOGCALL_VOID(CATEGORY, FUNC, PARAMS)
virtual void accumulate_stats(Xapian::Internal::ExpandStats &stats) const
Collate weighting information for the current term.
Abstract base class for termlists.
Collate statistics and calculate the term weights for the ESet.
#define AssertEqParanoid(A, B)
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Abstract base class for termlists.
Various assertion macros.