CLucene - a full-featured, c++ search engine
API Documentation
#include <FieldCache.h>
Public Member Functions | |
virtual | ~FieldCache () |
virtual FieldCacheAuto * | getInts (lucene::index::IndexReader *reader, const TCHAR *field)=0 |
Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as integers and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual FieldCacheAuto * | getFloats (lucene::index::IndexReader *reader, const TCHAR *field)=0 |
Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field as floats and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual FieldCacheAuto * | getStrings (lucene::index::IndexReader *reader, const TCHAR *field)=0 |
Checks the internal cache for an appropriate entry, and if none is found, reads the term values in field and returns an array of size reader.maxDoc() containing the value each document has in the given field. | |
virtual FieldCacheAuto * | getStringIndex (lucene::index::IndexReader *reader, const TCHAR *field)=0 |
Checks the internal cache for an appropriate entry, and if none is found reads the term values in field and returns an array of them in natural order, along with an array telling which element in the term array each document uses. | |
virtual FieldCacheAuto * | getAuto (lucene::index::IndexReader *reader, const TCHAR *field)=0 |
Checks the internal cache for an appropriate entry, and if none is found reads field to see if it contains integers, floats or strings, and then calls one of the other methods in this class to get the values. | |
virtual FieldCacheAuto * | getCustom (lucene::index::IndexReader *reader, const TCHAR *field, SortComparator *comparator)=0 |
Checks the internal cache for an appropriate entry, and if none is found reads the terms out of field and calls the given SortComparator to get the sort values. | |
Static Public Attributes | |
static int32_t | STRING_INDEX |
Indicator for FieldCache::StringIndex values in the cache. | |
static FieldCache * | DEFAULT |
Expert: The cache used internally by sorting and range query classes. | |
Data Structures | |
class | StringIndex |
Expert: Stores term text values and document ordering data. More... |
virtual lucene::search::FieldCache::~FieldCache | ( | ) | [inline, virtual] |
virtual FieldCacheAuto* lucene::search::FieldCache::getInts | ( | lucene::index::IndexReader * | reader, | |
const TCHAR * | field | |||
) | [pure virtual] |
Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field
as integers and returns an array of size reader.maxDoc()
of the value each document has in the given field.
reader | Used to get field values. | |
field | Which field contains the integers. |
IOException | If any error occurs. |
virtual FieldCacheAuto* lucene::search::FieldCache::getFloats | ( | lucene::index::IndexReader * | reader, | |
const TCHAR * | field | |||
) | [pure virtual] |
Checks the internal cache for an appropriate entry, and if none is found, reads the terms in field
as floats and returns an array of size reader.maxDoc()
of the value each document has in the given field.
reader | Used to get field values. | |
field | Which field contains the floats. |
IOException | If any error occurs. |
virtual FieldCacheAuto* lucene::search::FieldCache::getStrings | ( | lucene::index::IndexReader * | reader, | |
const TCHAR * | field | |||
) | [pure virtual] |
Checks the internal cache for an appropriate entry, and if none is found, reads the term values in field
and returns an array of size reader.maxDoc()
containing the value each document has in the given field.
reader | Used to get field values. | |
field | Which field contains the strings. |
IOException | If any error occurs. |
virtual FieldCacheAuto* lucene::search::FieldCache::getStringIndex | ( | lucene::index::IndexReader * | reader, | |
const TCHAR * | field | |||
) | [pure virtual] |
Checks the internal cache for an appropriate entry, and if none is found reads the term values in field
and returns an array of them in natural order, along with an array telling which element in the term array each document uses.
reader | Used to get field values. | |
field | Which field contains the strings. |
IOException | If any error occurs. |
virtual FieldCacheAuto* lucene::search::FieldCache::getAuto | ( | lucene::index::IndexReader * | reader, | |
const TCHAR * | field | |||
) | [pure virtual] |
Checks the internal cache for an appropriate entry, and if none is found reads field
to see if it contains integers, floats or strings, and then calls one of the other methods in this class to get the values.
For string values, a FieldCache::StringIndex is returned. After calling this method, there is an entry in the cache for both type AUTO
and the actual found type.
reader | Used to get field values. | |
field | Which field contains the values. |
IOException | If any error occurs. |
virtual FieldCacheAuto* lucene::search::FieldCache::getCustom | ( | lucene::index::IndexReader * | reader, | |
const TCHAR * | field, | |||
SortComparator * | comparator | |||
) | [pure virtual] |
Checks the internal cache for an appropriate entry, and if none is found reads the terms out of field
and calls the given SortComparator to get the sort values.
A hit in the cache will happen if reader
, field
, and comparator
are the same (using equals()
) as a previous call to this method.
reader | Used to get field values. | |
field | Which field contains the values. | |
comparator | Used to convert terms into something to sort by. |
IOException | If any error occurs. |
int32_t lucene::search::FieldCache::STRING_INDEX [static] |
Indicator for FieldCache::StringIndex values in the cache.
NOTE: the value assigned to this constant must not be the same as any of those in SortField!!
Expert: The cache used internally by sorting and range query classes.