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


lucene::search::FieldCacheImpl Class Reference

Expert: The default cache implementation, storing all values in memory. More...

#include <FieldCacheImpl.h>

Inheritance diagram for lucene::search::FieldCacheImpl:
lucene::search::FieldCache lucene::debug::LuceneBase

List of all members.

Classes

class  fieldcacheCacheReaderType
 the type that is stored in the field cache.
class  FileEntry
 Expert: Every key in the internal cache is of this type. More...

Public Member Functions

 FieldCacheImpl ()
 ~FieldCacheImpl ()
FieldCacheAutogetInts (lucene::index::IndexReader *reader, const TCHAR *field)
 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.
FieldCacheAutogetFloats (lucene::index::IndexReader *reader, const TCHAR *field)
 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.
FieldCacheAutogetStrings (lucene::index::IndexReader *reader, const TCHAR *field)
 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.
FieldCacheAutogetStringIndex (lucene::index::IndexReader *reader, const TCHAR *field)
 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.
FieldCacheAutogetAuto (lucene::index::IndexReader *reader, const TCHAR *field)
 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.
FieldCacheAutogetCustom (lucene::index::IndexReader *reader, const TCHAR *field, SortComparator *comparator)
 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 Member Functions

static void closeCallback (lucene::index::IndexReader *reader, void *fieldCacheImpl)
 Callback for when IndexReader closes.

Detailed Description

Expert: The default cache implementation, storing all values in memory.


Constructor & Destructor Documentation

lucene::search::FieldCacheImpl::FieldCacheImpl (  ) 
lucene::search::FieldCacheImpl::~FieldCacheImpl (  ) 

Member Function Documentation

static void lucene::search::FieldCacheImpl::closeCallback ( lucene::index::IndexReader reader,
void *  fieldCacheImpl 
) [static]

Callback for when IndexReader closes.

This causes any cache to be removed for the specified reader.

FieldCacheAuto* lucene::search::FieldCacheImpl::getAuto ( lucene::index::IndexReader reader,
const TCHAR *  field 
) [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.

Parameters:
reader Used to get field values.
field Which field contains the values.
Returns:
int32_t[], float_t[] or FieldCache::StringIndex.
Exceptions:
IOException If any error occurs.

Implements lucene::search::FieldCache.

FieldCacheAuto* lucene::search::FieldCacheImpl::getCustom ( lucene::index::IndexReader reader,
const TCHAR *  field,
SortComparator comparator 
) [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.

Parameters:
reader Used to get field values.
field Which field contains the values.
comparator Used to convert terms into something to sort by.
Returns:
Array of sort objects, one for each document.
Exceptions:
IOException If any error occurs.

Implements lucene::search::FieldCache.

FieldCacheAuto* lucene::search::FieldCacheImpl::getFloats ( lucene::index::IndexReader reader,
const TCHAR *  field 
) [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.

Parameters:
reader Used to get field values.
field Which field contains the floats.
Returns:
The values in the given field for each document.
Exceptions:
IOException If any error occurs.

Implements lucene::search::FieldCache.

FieldCacheAuto* lucene::search::FieldCacheImpl::getInts ( lucene::index::IndexReader reader,
const TCHAR *  field 
) [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.

Parameters:
reader Used to get field values.
field Which field contains the integers.
Returns:
The values in the given field for each document.
Exceptions:
IOException If any error occurs.

Implements lucene::search::FieldCache.

FieldCacheAuto* lucene::search::FieldCacheImpl::getStringIndex ( lucene::index::IndexReader reader,
const TCHAR *  field 
) [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.

Parameters:
reader Used to get field values.
field Which field contains the strings.
Returns:
Array of terms and index into the array for each document.
Exceptions:
IOException If any error occurs.

Implements lucene::search::FieldCache.

FieldCacheAuto* lucene::search::FieldCacheImpl::getStrings ( lucene::index::IndexReader reader,
const TCHAR *  field 
) [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.

Parameters:
reader Used to get field values.
field Which field contains the strings.
Returns:
The values in the given field for each document.
Exceptions:
IOException If any error occurs.

Implements lucene::search::FieldCache.


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

clucene.sourceforge.net