21 #ifndef XAPIAN_INCLUDED_COLLAPSER_H 22 #define XAPIAN_INCLUDED_COLLAPSER_H 50 std::vector<Xapian::Internal::MSetItem>
items;
61 : items(1, item), next_best_weight(0), collapse_count(0) {
62 items[0].collapse_key = std::string();
89 std::map<std::string, CollapseData>
table;
125 : entry_count(0), no_collapse_key(0), dups_ignored(0),
126 docs_considered(0), slot(slot_), collapse_max(collapse_max_),
130 operator bool()
const {
return collapse_max != 0; }
149 double min_weight)
const;
159 bool empty()
const {
return table.empty(); }
162 #endif // XAPIAN_INCLUDED_COLLAPSER_H Xapian::valueno slot
The value slot we're getting collapse keys from.
Abstract base class for postlists.
Xapian::doccount no_collapse_key
How many documents have we seen without a collapse key?
collapse_result add_item(const Xapian::Internal::MSetItem &item, Xapian::doccount collapse_max, MSetCmp mcmp, Xapian::Internal::MSetItem &old_item)
Handle a new MSetItem with this collapse key value.
std::map< std::string, CollapseData > table
Map from collapse key values to the items we're keeping for them.
std::vector< Xapian::Internal::MSetItem > items
Currently kept MSet entries for this value of the collapse key.
Collapser(Xapian::valueno slot_, Xapian::doccount collapse_max_)
A document in the database, possibly plus modifications.
CollapseData(const Xapian::Internal::MSetItem &item)
Construct with the given MSetItem item.
Xapian::doccount collapse_max
The maximum number of items to keep for each collapse key value.
Abstract base class for postlists.
Xapian::doccount get_dups_ignored() const
bool(* MSetCmp)(const Xapian::Internal::MSetItem &, const Xapian::Internal::MSetItem &)
An item resulting from a query.
double next_best_weight
The highest weight of a document we've rejected.
Xapian::doccount entry_count
How many items we're currently keeping in table.
double get_next_best_weight() const
The highest weight of a document we've rejected.
collapse_result
Enumeration reporting how a document was handled by the Collapser.
Xapian::doccount collapse_count
The number of documents we've rejected.
Xapian::doccount get_collapse_count() const
The number of documents we've rejected.
unsigned XAPIAN_DOCID_BASE_TYPE doccount
A count of documents.
Xapian::doccount dups_ignored
How many documents with duplicate collapse keys we have ignored.
MSetItem comparison functions.
Xapian::doccount docs_considered
How many documents we've considered for collapsing.
The Collapser class tracks collapse keys and the documents they match.
unsigned valueno
The number for a value slot in a document.
Xapian::doccount entries() const
Class tracking information for a given value of the collapse key.
Xapian::Internal::MSetItem old_item
Replaced item when REPLACED is returned by collapse().
Xapian::doccount get_docs_considered() const