Lucene++ - a full-featured, c++ search engine
API Documentation
A base class for ValueSource implementations that retrieve values for a single field from the FieldCache
.
More...
#include <FieldCacheSource.h>
Public Member Functions | |
FieldCacheSource (const String &field) | |
Create a cached field source for the input field. | |
virtual | ~FieldCacheSource () |
virtual String | getClassName () |
boost::shared_ptr< FieldCacheSource > | shared_from_this () |
virtual DocValuesPtr | getValues (const IndexReaderPtr &reader) |
Return the DocValues used by the function query. | |
virtual String | description () |
Description of field, used in explain() | |
virtual DocValuesPtr | getCachedFieldValues (const FieldCachePtr &cache, const String &field, const IndexReaderPtr &reader)=0 |
Return cached DocValues for input field and reader. | |
virtual bool | equals (const LuceneObjectPtr &other) |
Needed for possible caching of query results - used by ValueSourceQuery#equals(LuceneObjectPtr) . | |
virtual int32_t | hashCode () |
Needed for possible caching of query results - used by ValueSourceQuery#hashCode() . | |
virtual bool | cachedFieldSourceEquals (const FieldCacheSourcePtr &other)=0 |
Check if equals to another FieldCacheSource , already knowing that cache and field are equal. | |
virtual int32_t | cachedFieldSourceHashCode ()=0 |
Return a hash code of a FieldCacheSource , without the hash-codes of the field and the cache (those are taken care of elsewhere). | |
![]() | |
virtual | ~ValueSource () |
boost::shared_ptr< ValueSource > | shared_from_this () |
virtual String | toString () |
Returns a string representation of the object. | |
![]() | |
virtual | ~LuceneObject () |
virtual void | initialize () |
Called directly after instantiation to create objects that depend on this object being fully constructed. | |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Return clone of this object. | |
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
Compare two objects. | |
![]() | |
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 () |
Protected Attributes | |
String | field |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Additional Inherited Members | |
![]() | |
LuceneObject () | |
A base class for ValueSource implementations that retrieve values for a single field from the FieldCache
.
Fields used herein must be indexed (doesn't matter if these fields are stored or not).
It is assumed that each such indexed field is untokenized, or at least has a single token in a document. For documents with multiple tokens of the same field, behavior is undefined (It is likely that current code would use the value of one of these tokens, but this is not guaranteed).
Document with no tokens in this field are assigned the Zero value.
NOTE: with the switch in 2.9 to segment-based searching, if getValues
is invoked with a composite (multi-segment) reader, this can easily cause double RAM usage for the values in the FieldCache. It's best to switch your application to pass only atomic (single segment) readers to this API.
Lucene::FieldCacheSource::FieldCacheSource | ( | const String & | field | ) |
Create a cached field source for the input field.
|
virtual |
|
inlinestatic |
|
pure virtual |
Check if equals to another FieldCacheSource
, already knowing that cache and field are equal.
Implemented in Lucene::ByteFieldSource, Lucene::DoubleFieldSource, and Lucene::IntFieldSource.
|
pure virtual |
Return a hash code of a FieldCacheSource
, without the hash-codes of the field and the cache (those are taken care of elsewhere).
Implemented in Lucene::ByteFieldSource, Lucene::DoubleFieldSource, and Lucene::IntFieldSource.
|
virtual |
Description of field, used in explain()
Implements Lucene::ValueSource.
Reimplemented in Lucene::ByteFieldSource, Lucene::DoubleFieldSource, and Lucene::IntFieldSource.
|
virtual |
Needed for possible caching of query results - used by ValueSourceQuery#equals(LuceneObjectPtr)
.
Implements Lucene::ValueSource.
|
pure virtual |
Return cached DocValues for input field and reader.
cache | FieldCache so that values of a field are loaded once per reader (RAM allowing) |
field | Field for which values are required. |
Implemented in Lucene::ByteFieldSource, Lucene::DoubleFieldSource, and Lucene::IntFieldSource.
|
inlinevirtual |
Reimplemented from Lucene::ValueSource.
Reimplemented in Lucene::ByteFieldSource, Lucene::DoubleFieldSource, and Lucene::IntFieldSource.
|
virtual |
Return the DocValues used by the function query.
reader | The IndexReader used to read these values. If any caching is involved, that caching would also be IndexReader based. |
Implements Lucene::ValueSource.
|
virtual |
Needed for possible caching of query results - used by ValueSourceQuery#hashCode()
.
Implements Lucene::ValueSource.
|
inline |
|
protected |