Add db stats option to term explorer

This commit is contained in:
Jean-Francois Dockes
2013-01-10 15:12:43 +01:00
parent a4640c0a03
commit 29d4d959a5
7 changed files with 200 additions and 53 deletions
+4 -1
View File
@@ -1707,7 +1707,10 @@ bool Db::termMatch(MatchType typ, const string &lang,
Xapian::Database xdb = m_ndb->xrdb;
XAPTRY(res.dbdoccount = xdb.get_doccount();
res.dbavgdoclen = xdb.get_avlength(), xdb, m_reason);
res.dbavgdoclen = xdb.get_avlength();
res.mindoclen = xdb.get_doclength_lower_bound();
res.maxdoclen = xdb.get_doclength_upper_bound();
, xdb, m_reason);
if (!m_reason.empty())
return false;
+2
View File
@@ -121,6 +121,8 @@ public:
// Index-wide stats
unsigned int dbdoccount;
double dbavgdoclen;
size_t mindoclen;
size_t maxdoclen;
};
inline bool has_prefix(const string& trm)