#include <collapser.h>

Public Member Functions | |
| CollapseData (const Xapian::Internal::MSetItem &item) | |
| Construct with the given MSetItem item. | |
| collapse_result | add_item (const Xapian::Internal::MSetItem &item, Xapian::doccount collapse_max, const MSetCmp &mcmp, Xapian::Internal::MSetItem &old_item) |
| Handle a new MSetItem with this collapse key value. | |
| Xapian::weight | get_next_best_weight () const |
| The highest weight of a document we've rejected. | |
| Xapian::doccount | get_collapse_count () const |
| The number of documents we've rejected. | |
Private Attributes | |
| vector < Xapian::Internal::MSetItem > | items |
| Currently kept MSet entries for this value of the collapse key. | |
| Xapian::weight | next_best_weight |
| The highest weight of a document we've rejected. | |
| Xapian::doccount | collapse_count |
| The number of documents we've rejected. | |
Definition at line 40 of file collapser.h.
| CollapseData::CollapseData | ( | const Xapian::Internal::MSetItem & | item | ) | [inline] |
Construct with the given MSetItem item.
Definition at line 60 of file collapser.h.
References items.
| collapse_result CollapseData::add_item | ( | const Xapian::Internal::MSetItem & | item, | |
| Xapian::doccount | collapse_max, | |||
| const MSetCmp & | mcmp, | |||
| Xapian::Internal::MSetItem & | old_item | |||
| ) |
Handle a new MSetItem with this collapse key value.
| item | The new item. | |
| collapse_max | Max no. of items for each collapse key value. | |
| mcmp | MSetItem comparison functor. | |
| [out] | old_item | Replaced item (when REPLACED is returned). |
Definition at line 32 of file collapser.cc.
References ADDED, collapse_count, items, next_best_weight, REJECTED, REPLACED, and Xapian::Internal::MSetItem::wt.
Referenced by Collapser::process().
| Xapian::doccount CollapseData::get_collapse_count | ( | ) | const [inline] |
The number of documents we've rejected.
Definition at line 83 of file collapser.h.
References collapse_count.
| Xapian::weight CollapseData::get_next_best_weight | ( | ) | const [inline] |
The highest weight of a document we've rejected.
Definition at line 80 of file collapser.h.
References next_best_weight.
Xapian::doccount CollapseData::collapse_count [private] |
The number of documents we've rejected.
Definition at line 56 of file collapser.h.
Referenced by add_item(), and get_collapse_count().
vector<Xapian::Internal::MSetItem> CollapseData::items [private] |
Currently kept MSet entries for this value of the collapse key.
If collapse_max > 1, then this is a min-heap once items.size() reaches collapse_max.
FIXME: We expect collapse_max to be small, so perhaps we should preallocate space for that many entries and/or allocate space in larger blocks to divvy up?
Definition at line 50 of file collapser.h.
Referenced by add_item(), and CollapseData().
Xapian::weight CollapseData::next_best_weight [private] |
The highest weight of a document we've rejected.
Definition at line 53 of file collapser.h.
Referenced by add_item(), and get_next_best_weight().