40 string desc(
"TermFreqs(termfreq=");
41 desc +=
str(termfreq);
42 desc +=
", reltermfreq=";
43 desc +=
str(reltermfreq);
44 desc +=
", collfreq=";
45 desc +=
str(collfreq);
46 desc +=
", max_part=";
47 desc +=
str(max_part);
57 #ifdef XAPIAN_ASSERTIONS 66 map<string, TermFreqs>::const_iterator i;
68 termfreqs[i->first] += i->second;
77 #ifdef XAPIAN_ASSERTIONS 83 rset_size += rset.
size();
87 const string & term = *t;
97 const set<Xapian::docid> & items(rset.
internal->get_items());
98 set<Xapian::docid>::const_iterator d;
99 for (d = items.begin(); d != items.end(); ++d) {
106 map<string, TermFreqs>::iterator i;
107 for (i = termfreqs.begin(); i != termfreqs.end(); ++i) {
108 const string & term = i->first;
114 if (term == tl->get_termname())
115 ++i->second.reltermfreq;
125 double& max_part = termfreqs[i.first].max_part;
126 max_part = max(max_part, i.second.max_part);
131 Weight::Internal::get_description()
const 133 string desc =
"Weight::Internal(totlen=";
134 desc +=
str(total_length);
135 desc +=
", collection_size=";
136 desc +=
str(collection_size);
137 desc +=
", rset_size=";
138 desc +=
str(rset_size);
139 #ifdef XAPIAN_ASSERTIONS 142 desc +=
", finalised=";
143 desc +=
str(finalised);
145 desc +=
", termfreqs={";
146 map<string, TermFreqs>::const_iterator i;
147 for (i = termfreqs.begin(); i != termfreqs.end(); ++i) {
148 if (i != termfreqs.begin())
152 desc += i->second.get_description();
The Xapian namespace contains public interfaces for the Xapian library.
Xapian::doccount size() const
The number of documents in this R-Set.
virtual TermList * open_term_list(Xapian::docid did) const =0
Open a term list.
std::string get_description() const
Return a std::string describing this object.
Base class for databases.
virtual Internal * skip_to(const std::string &term)=0
Skip forward to the specified term.
Abstract base class for termlists.
Convert types to std::string.
Xapian::doccount termfreq
const TermIterator get_unique_terms_begin() const
Begin iterator for unique terms in the query object.
std::map< std::string, TermFreqs > termfreqs
Map of term frequencies and relevant term frequencies for the collection.
Xapian::doccount collection_size
Number of documents in the collection.
Xapian::Internal::intrusive_ptr< Internal > internal
Xapian::doccount rset_size
Number of relevant documents in the collection.
Class for iterating over a list of terms.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
bool have_max_part
Has max_part been set for any term?
Xapian::Weight::Internal class, holding database and term statistics.
Class to hold statistics for a given collection.
string str(int value)
Convert int to std::string.
Xapian::termcount collfreq
virtual Xapian::totallength get_total_length() const =0
Return the total length of all documents in this database.
static Xapian::Query query(Xapian::Query::op op, const string &t1=string(), const string &t2=string(), const string &t3=string(), const string &t4=string(), const string &t5=string(), const string &t6=string(), const string &t7=string(), const string &t8=string(), const string &t9=string(), const string &t10=string())
The frequencies for a term.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
virtual void get_freqs(const string &term, Xapian::doccount *termfreq_ptr, Xapian::termcount *collfreq_ptr) const =0
Returns frequencies for a term.
Abstract base class for termlists.
virtual Xapian::doccount get_doccount() const =0
Return the number of docs in this (sub) database.
Various assertion macros.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
Xapian::totallength total_length
Total length of all documents in the collection.
Wrapper around standard unique_ptr template.