CLucene - a full-featured, c++ search engine
API Documentation
#include <FieldSortedHitQueue.h>
Public Member Functions | |
FieldSortedHitQueue (lucene::index::IndexReader *reader, SortField **fields, int32_t size) | |
Creates a hit queue sorted by the given list of fields. | |
~FieldSortedHitQueue () | |
FieldDoc * | fillFields (FieldDoc *doc) const |
Given a FieldDoc object, stores the values used to sort the given document. | |
void | setFields (SortField **fields) |
SortField ** | getFields () |
Returns the SortFields being used by this hit queue. | |
Static Public Member Functions | |
static void | shutdown () |
static void | closeCallback (lucene::index::IndexReader *reader, void *param) |
Callback for when IndexReader closes. | |
Static Public Attributes | |
static hitqueueCacheType * | Comparators |
Internal cache of comparators. | |
Protected Member Functions | |
bool | lessThan (FieldDoc *docA, FieldDoc *docB) |
Returns whether a is less relevant than b . | |
Protected Attributes | |
ScoreDocComparator ** | comparators |
Stores a comparator corresponding to each field being sorted by. | |
int32_t | comparatorsLen |
SortField ** | fields |
Stores the sort criteria being used. | |
int32_t | fieldsLen |
float_t | maxscore |
Stores the maximum score value encountered, for normalizing. |
Uses FieldCache.DEFAULT
for maintaining internal term lookup tables.
lucene::search::FieldSortedHitQueue::FieldSortedHitQueue | ( | lucene::index::IndexReader * | reader, | |
SortField ** | fields, | |||
int32_t | size | |||
) |
Creates a hit queue sorted by the given list of fields.
reader | Index to use. | |
fields | Field names, in priority order (highest priority first). Cannot be null or empty. | |
size | The number of hits to retain. Must be greater than zero. |
IOException |
lucene::search::FieldSortedHitQueue::~FieldSortedHitQueue | ( | ) |
static void lucene::search::FieldSortedHitQueue::shutdown | ( | ) | [static] |
static void lucene::search::FieldSortedHitQueue::closeCallback | ( | lucene::index::IndexReader * | reader, | |
void * | param | |||
) | [static] |
Callback for when IndexReader closes.
This causes any Comparators to be removed for the specified reader.
Given a FieldDoc object, stores the values used to sort the given document.
These values are not the raw values out of the index, but the internal representation of them. This is so the given search hit can be collated by a MultiSearcher with other search hits.
void lucene::search::FieldSortedHitQueue::setFields | ( | SortField ** | fields | ) | [inline] |
SortField** lucene::search::FieldSortedHitQueue::getFields | ( | ) | [inline] |
Returns the SortFields being used by this hit queue.
hitqueueCacheType* lucene::search::FieldSortedHitQueue::Comparators [static] |
Internal cache of comparators.
Similar to FieldCache, only caches comparators instead of term values.
Stores a comparator corresponding to each field being sorted by.
int32_t lucene::search::FieldSortedHitQueue::comparatorsLen [protected] |
SortField** lucene::search::FieldSortedHitQueue::fields [protected] |
Stores the sort criteria being used.
int32_t lucene::search::FieldSortedHitQueue::fieldsLen [protected] |
float_t lucene::search::FieldSortedHitQueue::maxscore [protected] |
Stores the maximum score value encountered, for normalizing.
we only care about scores greater than 1.0 - if all the scores are less than 1.0, we don't have to normalize.