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