CollapseData Class Reference

Class tracking information for a given value of the collapse key. More...

#include <collapser.h>

Collaboration diagram for CollapseData:

Collaboration graph
[legend]

List of all members.

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.


Detailed Description

Class tracking information for a given value of the collapse key.

Definition at line 40 of file collapser.h.


Constructor & Destructor Documentation

CollapseData::CollapseData ( const Xapian::Internal::MSetItem item  )  [inline]

Construct with the given MSetItem item.

Definition at line 60 of file collapser.h.

References items.


Member Function Documentation

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.

Parameters:
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).
Returns:
How item was handled: ADDED, REJECTED or REPLACED.

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.


Member Data Documentation

The number of documents we've rejected.

Definition at line 56 of file collapser.h.

Referenced by add_item(), and get_collapse_count().

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().

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().


The documentation for this class was generated from the following files:

Documentation for Xapian (version 1.2.9).
Generated on 10 May 2012 by Doxygen 1.5.9.