55 map<string, TermFreqs>::const_iterator i;
101 double max_part = 0.0;
136 for (
size_t i = 0; i != mset.
size(); ++i) {
175 vector<Xapian::Internal::MSetItem> items;
178 while (msize-- > 0) {
184 string sort_key(p, len);
192 swap(items.back().sort_key, sort_key);
195 AutoPtr<Xapian::Weight::Internal> stats;
207 uncollapsed_upper_bound,
208 uncollapsed_lower_bound,
209 uncollapsed_estimated,
210 max_possible, max_attained,
211 items, percent_factor);
212 mset.
internal->stats = stats.release();
220 const set<Xapian::docid> & items = rset.
internal->get_items();
221 set<Xapian::docid>::const_iterator i;
223 for (i = items.begin(); i != items.end(); ++i) {
236 const char * p = s.data();
237 const char * p_end = p + s.
size();
298 const char * p = s.data();
299 const char * p_end = p + s.size();
Xapian::doccount size() const
Return number of items in this MSet object.
Xapian::doccount size() const
The number of documents in this R-Set.
void add_value(Xapian::valueno slot, const std::string &value)
Add a new value.
double get_max_possible() const
The maximum possible weight any document could achieve.
Xapian::RSet unserialise_rset(const string &s)
Unserialise a serialised Xapian::RSet object.
length encoded as a string
Xapian::termcount termlist_count() const
The length of the termlist - i.e.
Xapian::Document unserialise_document(const string &s)
Unserialise a serialised Xapian::Document object.
Xapian::doccount collapse_count
Count of collapses done on collapse_key so far.
XAPIAN_TOTALLENGTH_TYPE totallength
The total length of all documents in a database.
Xapian::docid did
Document id.
ValueIterator values_begin() const
Iterator for the values in this document.
Xapian::Internal::intrusive_ptr< Internal > internal
double get_max_attained() const
The maximum weight attained by any document.
Class for iterating over document values.
Class representing a list of search results.
std::string encode_length(T len)
Encode a length as a variable-length string.
TermIterator termlist_end() const
Equivalent end iterator for termlist_begin().
Class for iterating over term positions.
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.
string sort_key
Used when sorting by value.
Xapian::Internal::intrusive_ptr< Internal > internal
Xapian::doccount rset_size
Number of relevant documents in the collection.
Xapian::MSet unserialise_mset(const char *p, const char *p_end)
Unserialise a serialised Xapian::MSet object.
Class for iterating over a list of terms.
unsigned XAPIAN_TERMCOUNT_BASE_TYPE termcount
A counts of terms.
functions to serialise and unserialise a double
PositionIterator positionlist_end() const
Return an end PositionIterator for the current term.
Xapian::doccount get_uncollapsed_matches_estimated() const
Estimate of the total number of matching documents before collapsing.
double unserialise_double(const char **p, const char *end)
Unserialise a double serialised by serialise_double.
Xapian::doccount get_firstitem() const
Rank of first item in this MSet.
bool have_max_part
Has max_part been set for any term?
Xapian::Weight::Internal class, holding database and term statistics.
double wt
Weight calculated.
Class to hold statistics for a given collection.
string collapse_key
Value which was used to collapse upon.
An item resulting from a query.
Class for iterating over document values.
Xapian::termcount values_count() const
Count the values in this document.
Class for iterating over term positions.
Xapian::termcount get_wdf() const
Return the wdf for the term at the current position.
ValueIterator values_end() const
Equivalent end iterator for values_begin().
string serialise_stats(const Xapian::Weight::Internal &stats)
Serialise a stats object.
functions to convert classes to strings and back
string serialise_rset(const Xapian::RSet &rset)
Serialise a Xapian::RSet object.
void add_posting(const std::string &tname, Xapian::termpos tpos, Xapian::termcount wdfinc=1)
Add an occurrence of a term at a particular position.
void add_document(Xapian::docid did)
Add a document to the relevance set.
string serialise_document(const Xapian::Document &doc)
Serialise a Xapian::Document object.
The frequencies for a term.
void unserialise_stats(const char *p, const char *p_end, Xapian::Weight::Internal &stat)
Unserialise a serialised stats object.
std::string serialise_double(double v)
Serialise a double to a string.
void decode_length_and_check(const char **p, const char *end, unsigned &out)
Decode a length encoded by encode_length.
string serialise_mset(const Xapian::MSet &mset)
Serialise a Xapian::MSet object.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Xapian::doccount get_uncollapsed_matches_upper_bound() const
Upper bound on the total number of matching documents before collapsing.
unsigned valueno
The number for a value slot in a document.
unsigned XAPIAN_TERMPOS_BASE_TYPE termpos
A term position within a document or query.
Various assertion macros.
unsigned XAPIAN_DOCID_BASE_TYPE docid
A unique identifier for a document.
std::string get_data() const
Get data stored in the document.
API for working with documents.
Xapian::totallength total_length
Total length of all documents in the collection.
Class for iterating over a list of terms.
void set_data(const std::string &data)
Set data stored in the document.
void decode_length(const char **p, const char *end, unsigned &out)
Decode a length encoded by encode_length.
TermIterator termlist_begin() const
Start iterating the terms in this document.
PositionIterator positionlist_begin() const
Return a PositionIterator for the current term.
A handle representing a document in a Xapian database.
Wrapper around standard unique_ptr template.
Xapian::termcount positionlist_count() const
Return the length of the position list for the current position.
Xapian::valueno get_valueno() const
Return the value slot number for the current position.
Xapian::doccount get_uncollapsed_matches_lower_bound() const
Lower bound on the total number of matching documents before collapsing.
void add_term(const std::string &tname, Xapian::termcount wdfinc=1)
Add a term to the document, without positional information.