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::DoubleFieldSource Class Reference

Obtains double field values from the FieldCache using getDoubles() and makes those values available as other numeric types, casting as needed. More...

#include <DoubleFieldSource.h>

+ Inheritance diagram for Lucene::DoubleFieldSource:

Public Member Functions

 DoubleFieldSource (const String &field, DoubleParserPtr parser=DoubleParserPtr())
 Create a cached double field source with a specific string-to-double parser. More...
 
virtual ~DoubleFieldSource ()
 
virtual String getClassName ()
 
boost::shared_ptr
< DoubleFieldSource
shared_from_this ()
 
virtual String description ()
 Description of field, used in explain() More...
 
virtual DocValuesPtr getCachedFieldValues (FieldCachePtr cache, const String &field, IndexReaderPtr reader)
 Return cached DocValues for input field and reader. More...
 
virtual bool cachedFieldSourceEquals (FieldCacheSourcePtr other)
 Check if equals to another FieldCacheSource, already knowing that cache and field are equal. More...
 
virtual int32_t cachedFieldSourceHashCode ()
 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::FieldCacheSource
 FieldCacheSource (const String &field)
 Create a cached field source for the input field. More...
 
virtual ~FieldCacheSource ()
 
boost::shared_ptr
< FieldCacheSource
shared_from_this ()
 
virtual DocValuesPtr getValues (IndexReaderPtr reader)
 Return the DocValues used by the function query. 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...
 
- 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::FieldCacheSource
static String _getClassName ()
 
- Static Public Member Functions inherited from Lucene::ValueSource
static String _getClassName ()
 

Protected Attributes

DoubleParserPtr parser
 
- Protected Attributes inherited from Lucene::FieldCacheSource
String field
 

Additional Inherited Members

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

Detailed Description

Obtains double field values from the FieldCache using getDoubles() and makes those values available as other numeric types, casting as needed.

See Also
FieldCacheSource for requirements on the field.

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. Alternatively, for a short-term fix, you could wrap your ValueSource using MultiValueSource, which costs more CPU per lookup but will not consume double the FieldCache RAM.

Constructor & Destructor Documentation

Lucene::DoubleFieldSource::DoubleFieldSource ( const String &  field,
DoubleParserPtr  parser = DoubleParserPtr() 
)

Create a cached double field source with a specific string-to-double parser.

virtual Lucene::DoubleFieldSource::~DoubleFieldSource ( )
virtual

Member Function Documentation

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

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

Implements Lucene::FieldCacheSource.

virtual int32_t Lucene::DoubleFieldSource::cachedFieldSourceHashCode ( )
virtual

Return a hash code of a FieldCacheSource, without the hash-codes of the field and the cache (those are taken care of elsewhere).

Implements Lucene::FieldCacheSource.

virtual String Lucene::DoubleFieldSource::description ( )
virtual

Description of field, used in explain()

Reimplemented from Lucene::FieldCacheSource.

virtual DocValuesPtr Lucene::DoubleFieldSource::getCachedFieldValues ( FieldCachePtr  cache,
const String &  field,
IndexReaderPtr  reader 
)
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

Implements Lucene::FieldCacheSource.

virtual String Lucene::DoubleFieldSource::getClassName ( )
inlinevirtual

Reimplemented from Lucene::FieldCacheSource.

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

Field Documentation

DoubleParserPtr Lucene::DoubleFieldSource::parser
protected

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

clucene.sourceforge.net