CLucene - a full-featured, c++ search engine
API Documentation


lucene::search::FieldSortedHitQueue Class Reference

Expert: A hit queue for sorting by hits by terms in more than one field. More...

#include <FieldSortedHitQueue.h>

Inheritance diagram for lucene::search::FieldSortedHitQueue:
lucene::util::PriorityQueue< FieldDoc *, lucene::util::Deletor::Object< FieldDoc > > lucene::debug::LuceneBase

List of all members.

Classes

class  hitqueueCacheReaderType
 the type that is stored in the field cache.

Public Types

typedef
lucene::util::CLHashMap
< lucene::index::IndexReader
*, hitqueueCacheReaderType
*, lucene::util::Compare::Void
< lucene::index::IndexReader >
, lucene::util::Equals::Void
< lucene::index::IndexReader >
, lucene::util::Deletor::Object
< lucene::index::IndexReader >
, lucene::util::Deletor::Object
< hitqueueCacheReaderType > > 
hitqueueCacheType

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

Detailed Description

Expert: A hit queue for sorting by hits by terms in more than one field.

Uses FieldCache.DEFAULT for maintaining internal term lookup tables.

See also:
Searchable::search(Query,Filter,int32_t,Sort)
FieldCache

Member Typedef Documentation

typedef lucene:: util ::CLHashMap<lucene:: index ::IndexReader*, hitqueueCacheReaderType*, lucene:: util ::Compare::Void<lucene:: index ::IndexReader>, lucene:: util ::Equals::Void<lucene:: index ::IndexReader>, lucene:: util ::Deletor::Object<lucene:: index ::IndexReader>, lucene:: util ::Deletor::Object<hitqueueCacheReaderType> > lucene::search::FieldSortedHitQueue::hitqueueCacheType

Constructor & Destructor Documentation

lucene::search::FieldSortedHitQueue::FieldSortedHitQueue ( lucene::index::IndexReader reader,
SortField **  fields,
int32_t  size 
)

Creates a hit queue sorted by the given list of fields.

Parameters:
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.
Exceptions:
IOException 
lucene::search::FieldSortedHitQueue::~FieldSortedHitQueue (  ) 

Member Function Documentation

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.

FieldDoc* lucene::search::FieldSortedHitQueue::fillFields ( FieldDoc doc  )  const

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.

Parameters:
doc The FieldDoc to store sort values into.
Returns:
The same FieldDoc passed in.
See also:
Searchable::search(Query,Filter,int32_t,Sort)
SortField** lucene::search::FieldSortedHitQueue::getFields (  )  [inline]

Returns the SortFields being used by this hit queue.

bool lucene::search::FieldSortedHitQueue::lessThan ( FieldDoc docA,
FieldDoc docB 
) [protected]

Returns whether a is less relevant than b.

Parameters:
a ScoreDoc
b ScoreDoc
Returns:
true if document a should be sorted after document b.
void lucene::search::FieldSortedHitQueue::setFields ( SortField **  fields  )  [inline]

Member Data Documentation

Stores a comparator corresponding to each field being sorted by.

Internal cache of comparators.

Similar to FieldCache, only caches comparators instead of term values.

Stores the sort criteria being used.

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.


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

clucene.sourceforge.net