Lucene++ - a full-featured, c++ search engine
API Documentation
The default cache implementation, storing all values in memory. A WeakHashMap is used for storage. More...
#include <FieldCacheImpl.h>
Public Member Functions | |
FieldCacheImpl () | |
virtual | ~FieldCacheImpl () |
virtual String | getClassName () |
boost::shared_ptr< FieldCacheImpl > | shared_from_this () |
virtual void | initialize () |
Called directly after instantiation to create objects that depend on this object being fully constructed. | |
virtual void | purgeAllCaches () |
Instructs the FieldCache to forcibly expunge all entries from the underlying caches. This is intended only to be used for test methods as a way to ensure a known base state of the Cache. It should not be relied on for "Cache maintenance" in general application code. | |
virtual void | purge (const IndexReaderPtr &r) |
Drops all cache entries associated with this reader. NOTE: this reader must precisely match the reader that the cache entry is keyed on. If you pass a top-level reader, it usually will have no effect as Lucene now caches at the segment reader level. | |
virtual Collection< FieldCacheEntryPtr > | getCacheEntries () |
Generates an array of CacheEntry objects representing all items currently in the FieldCache. | |
virtual Collection< uint8_t > | getBytes (const IndexReaderPtr &reader, const String &field) |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as a single byte and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual Collection< uint8_t > | getBytes (const IndexReaderPtr &reader, const String &field, const ByteParserPtr &parser) |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as bytes and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual Collection< int32_t > | getInts (const IndexReaderPtr &reader, const String &field) |
Checks the internal cache for an appropriate entry, and if none are 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 Collection< int32_t > | getInts (const IndexReaderPtr &reader, const String &field, const IntParserPtr &parser) |
Checks the internal cache for an appropriate entry, and if none are 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 Collection< int64_t > | getLongs (const IndexReaderPtr &reader, const String &field) |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as longs and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual Collection< int64_t > | getLongs (const IndexReaderPtr &reader, const String &field, const LongParserPtr &parser) |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as longs and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual Collection< double > | getDoubles (const IndexReaderPtr &reader, const String &field) |
Checks the internal cache for an appropriate entry, and if none are 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 Collection< double > | getDoubles (const IndexReaderPtr &reader, const String &field, const DoubleParserPtr &parser) |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as doubles and returns an array of size reader.maxDoc() of the value each document has in the given field. | |
virtual Collection< String > | getStrings (const IndexReaderPtr &reader, const String &field) |
Checks the internal cache for an appropriate entry, and if none are 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 StringIndexPtr | getStringIndex (const IndexReaderPtr &reader, const String &field) |
Checks the internal cache for an appropriate entry, and if none are 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 void | setInfoStream (const InfoStreamPtr &stream) |
If non-null, FieldCacheImpl will warn whenever entries are created that are not sane according to FieldCacheSanityChecker . | |
virtual InfoStreamPtr | getInfoStream () |
![]() | |
virtual | ~FieldCache () |
![]() | |
virtual | ~LuceneObject () |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Return clone of this object. | |
virtual int32_t | hashCode () |
Return hash code for this object. | |
virtual bool | equals (const LuceneObjectPtr &other) |
Return whether two objects are equal. | |
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
Compare two objects. | |
virtual String | toString () |
Returns a string representation of the object. | |
![]() | |
virtual | ~LuceneSync () |
virtual SynchronizePtr | getSync () |
Return this object synchronize lock. | |
virtual LuceneSignalPtr | getSignal () |
Return this object signal. | |
virtual void | lock (int32_t timeout=0) |
Lock this object using an optional timeout. | |
virtual void | unlock () |
Unlock this object. | |
virtual bool | holdsLock () |
Returns true if this object is currently locked by current thread. | |
virtual void | wait (int32_t timeout=0) |
Wait for signal using an optional timeout. | |
virtual void | notifyAll () |
Notify all threads waiting for signal. | |
Static Public Member Functions | |
static String | _getClassName () |
![]() | |
static String | _getClassName () |
static FieldCachePtr | DEFAULT () |
The cache used internally by sorting and range query classes. | |
static ByteParserPtr | DEFAULT_BYTE_PARSER () |
The default parser for byte values, which are encoded by StringUtils::toInt. | |
static IntParserPtr | DEFAULT_INT_PARSER () |
The default parser for int values, which are encoded by StringUtils::toInt. | |
static LongParserPtr | DEFAULT_LONG_PARSER () |
The default parser for int values, which are encoded by StringUtils::toLong. | |
static DoubleParserPtr | DEFAULT_DOUBLE_PARSER () |
The default parser for double values, which are encoded by StringUtils::toDouble. | |
static IntParserPtr | NUMERIC_UTILS_INT_PARSER () |
A parser instance for int values encoded by NumericUtils#prefixCodedToInt(String) , eg. when indexed via NumericField /NumericTokenStream . | |
static LongParserPtr | NUMERIC_UTILS_LONG_PARSER () |
A parser instance for long values encoded by NumericUtils#prefixCodedToLong(String) , eg. when indexed via NumericField /NumericTokenStream . | |
static DoubleParserPtr | NUMERIC_UTILS_DOUBLE_PARSER () |
A parser instance for double values encoded by NumericUtils , eg. when indexed via NumericField /NumericTokenStream . | |
Protected Attributes | |
MapStringCache | caches |
InfoStreamPtr | infoStream |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Additional Inherited Members | |
![]() | |
enum | CacheType { CACHE_BYTE = 1 , CACHE_INT , CACHE_LONG , CACHE_DOUBLE , CACHE_STRING , CACHE_STRING_INDEX } |
Specifies whether and how a field should be stored. More... | |
![]() | |
static const int32_t | STRING_INDEX |
Indicator for StringIndex values in the cache. NOTE: the value assigned to this constant must not be the same as any of those in SortField. | |
![]() | |
LuceneObject () | |
The default cache implementation, storing all values in memory. A WeakHashMap is used for storage.
Lucene::FieldCacheImpl::FieldCacheImpl | ( | ) |
|
virtual |
|
inlinestatic |
|
virtual |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as a single byte 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 single byte values. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as bytes 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 bytes. |
parser | Computes byte for string values. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Generates an array of CacheEntry objects representing all items currently in the FieldCache.
Implements Lucene::FieldCache.
|
inlinevirtual |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are 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 doubles. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as doubles 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 doubles. |
parser | Computes double for string values. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are 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. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are 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. |
parser | Computes integer for string values. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as longs 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 longs. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are found, reads the terms in field as longs 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 longs. |
parser | Computes long for string values. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are 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. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Checks the internal cache for an appropriate entry, and if none are 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. |
Reimplemented from Lucene::FieldCache.
|
virtual |
Called directly after instantiation to create objects that depend on this object being fully constructed.
Reimplemented from Lucene::LuceneObject.
|
virtual |
Drops all cache entries associated with this reader. NOTE: this reader must precisely match the reader that the cache entry is keyed on. If you pass a top-level reader, it usually will have no effect as Lucene now caches at the segment reader level.
Implements Lucene::FieldCache.
|
virtual |
Instructs the FieldCache to forcibly expunge all entries from the underlying caches. This is intended only to be used for test methods as a way to ensure a known base state of the Cache. It should not be relied on for "Cache maintenance" in general application code.
Implements Lucene::FieldCache.
|
virtual |
If non-null, FieldCacheImpl will warn whenever entries are created that are not sane according to FieldCacheSanityChecker
.
Reimplemented from Lucene::FieldCache.
|
inline |
|
protected |
|
protected |