xapian-core
1.4.27
|
Class tracking information for a given value of the collapse key. More...
#include <collapser.h>
Public Member Functions | |
CollapseData (const Xapian::Internal::MSetItem &item) | |
Construct with the given MSetItem item. More... | |
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. More... | |
double | get_next_best_weight () const |
The highest weight of a document we've rejected. More... | |
Xapian::doccount | get_collapse_count () const |
The number of documents we've rejected. More... | |
Private Attributes | |
std::vector< Xapian::Internal::MSetItem > | items |
Currently kept MSet entries for this value of the collapse key. More... | |
double | next_best_weight |
The highest weight of a document we've rejected. More... | |
Xapian::doccount | collapse_count |
The number of documents we've rejected. More... | |
Class tracking information for a given value of the collapse key.
Definition at line 41 of file collapser.h.
|
inlineexplicit |
Construct with the given MSetItem item.
Definition at line 60 of file collapser.h.
References add_item().
collapse_result CollapseData::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.
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, REJECTED, REPLACED, and Xapian::Internal::MSetItem::wt.
Referenced by CollapseData(), and Collapser::process().
|
inline |
The number of documents we've rejected.
Definition at line 83 of file collapser.h.
References collapse_count.
Referenced by Collapser::operator bool().
|
inline |
The highest weight of a document we've rejected.
Definition at line 80 of file collapser.h.
References next_best_weight.
|
private |
The number of documents we've rejected.
Definition at line 56 of file collapser.h.
Referenced by get_collapse_count().
|
private |
Currently kept MSet entries for this value of the collapse key.
If collapse_max > 1, then this is a min-heap once collapse_count > 0.
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.
|
private |
The highest weight of a document we've rejected.
Definition at line 53 of file collapser.h.
Referenced by get_next_best_weight().