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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Protected Attributes
Lucene::FieldCacheSource Class Referenceabstract

A base class for ValueSource implementations that retrieve values for a single field from the FieldCache. More...

#include <FieldCacheSource.h>

+ Inheritance diagram for Lucene::FieldCacheSource:

Public Member Functions

 FieldCacheSource (const String &field)
 Create a cached field source for the input field. More...
 
virtual ~FieldCacheSource ()
 
virtual String getClassName ()
 
boost::shared_ptr
< FieldCacheSource
shared_from_this ()
 
virtual DocValuesPtr getValues (IndexReaderPtr reader)
 Return the DocValues used by the function query. More...
 
virtual String description ()
 Description of field, used in explain() More...
 
virtual DocValuesPtr getCachedFieldValues (FieldCachePtr cache, const String &field, IndexReaderPtr reader)=0
 Return cached DocValues for input field and reader. More...
 
virtual bool equals (LuceneObjectPtr other)
 Needed for possible caching of query results - used by ValueSourceQuery#equals(LuceneObjectPtr). More...
 
virtual int32_t hashCode ()
 Needed for possible caching of query results - used by ValueSourceQuery#hashCode(). More...
 
virtual bool cachedFieldSourceEquals (FieldCacheSourcePtr other)=0
 Check if equals to another FieldCacheSource, already knowing that cache and field are equal. More...
 
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). More...
 
- Public Member Functions inherited from Lucene::ValueSource
virtual ~ValueSource ()
 
boost::shared_ptr< ValueSourceshared_from_this ()
 
virtual String toString ()
 Returns a string representation of the object. More...
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed. More...
 
virtual LuceneObjectPtr clone (LuceneObjectPtr other=LuceneObjectPtr())
 Return clone of this object. More...
 
virtual int32_t compareTo (LuceneObjectPtr other)
 Compare two objects. More...
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock. More...
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal. More...
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout. More...
 
virtual void unlock ()
 Unlock this object. More...
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread. More...
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout. More...
 
virtual void notifyAll ()
 Notify all threads waiting for signal. More...
 

Static Public Member Functions

static String _getClassName ()
 
- Static Public Member Functions inherited from Lucene::ValueSource
static String _getClassName ()
 

Protected Attributes

String field
 

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Detailed Description

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.

Constructor & Destructor Documentation

Lucene::FieldCacheSource::FieldCacheSource ( const String &  field)

Create a cached field source for the input field.

virtual Lucene::FieldCacheSource::~FieldCacheSource ( )
virtual

Member Function Documentation

static String Lucene::FieldCacheSource::_getClassName ( )
inlinestatic
virtual bool Lucene::FieldCacheSource::cachedFieldSourceEquals ( FieldCacheSourcePtr  other)
pure virtual

Check if equals to another FieldCacheSource, already knowing that cache and field are equal.

Implemented in Lucene::DoubleFieldSource, Lucene::ByteFieldSource, and Lucene::IntFieldSource.

virtual int32_t Lucene::FieldCacheSource::cachedFieldSourceHashCode ( )
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::DoubleFieldSource, Lucene::ByteFieldSource, and Lucene::IntFieldSource.

virtual String Lucene::FieldCacheSource::description ( )
virtual

Description of field, used in explain()

Implements Lucene::ValueSource.

Reimplemented in Lucene::DoubleFieldSource, Lucene::ByteFieldSource, and Lucene::IntFieldSource.

virtual bool Lucene::FieldCacheSource::equals ( LuceneObjectPtr  other)
virtual

Needed for possible caching of query results - used by ValueSourceQuery#equals(LuceneObjectPtr).

Implements Lucene::ValueSource.

virtual DocValuesPtr Lucene::FieldCacheSource::getCachedFieldValues ( FieldCachePtr  cache,
const String &  field,
IndexReaderPtr  reader 
)
pure virtual

Return cached DocValues for input field and reader.

Parameters
cacheFieldCache so that values of a field are loaded once per reader (RAM allowing)
fieldField for which values are required.
See Also
ValueSource

Implemented in Lucene::DoubleFieldSource, Lucene::ByteFieldSource, and Lucene::IntFieldSource.

virtual String Lucene::FieldCacheSource::getClassName ( )
inlinevirtual
virtual DocValuesPtr Lucene::FieldCacheSource::getValues ( IndexReaderPtr  reader)
virtual

Return the DocValues used by the function query.

Parameters
readerThe IndexReader used to read these values. If any caching is involved, that caching would also be IndexReader based.

Implements Lucene::ValueSource.

virtual int32_t Lucene::FieldCacheSource::hashCode ( )
virtual

Needed for possible caching of query results - used by ValueSourceQuery#hashCode().

Implements Lucene::ValueSource.

boost::shared_ptr< FieldCacheSource > Lucene::FieldCacheSource::shared_from_this ( )
inline

Field Documentation

String Lucene::FieldCacheSource::field
protected

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

clucene.sourceforge.net