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

Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
Lucene::FieldSelector Class Referenceabstract

The FieldSelector allows one to make decisions about what Fields get loaded on a Document by IndexReader#document(int32_t, FieldSelector). More...

`#include <FieldSelector.h>`

Inheritance diagram for Lucene::FieldSelector:

## Public Types

enum | FieldSelectorResult { SELECTOR_NULL , SELECTOR_LOAD , SELECTOR_LAZY_LOAD , SELECTOR_NO_LOAD , SELECTOR_LOAD_AND_BREAK , SELECTOR_SIZE , SELECTOR_SIZE_AND_BREAK }
| Provides information about what should be done with this Field. More...

## Public Member Functions

virtual | ~FieldSelector ()
virtual String | getClassName ()
boost::shared_ptr< FieldSelector > | shared_from_this ()
virtual FieldSelectorResult | accept (const String &fieldName)=0
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 (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. 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 ()

## Protected Member Functions

| FieldSelector ()
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Additional Inherited Members

Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Detailed Description

The FieldSelector allows one to make decisions about what Fields get loaded on a Document by IndexReader#document(int32_t, FieldSelector).

## Member Enumeration Documentation

## ◆ FieldSelectorResult

enum Lucene::FieldSelector::FieldSelectorResult

Provides information about what should be done with this Field.

Enumerator
SELECTOR_NULL | Null value.
SELECTOR_LOAD | Load this Field every time the Document is loaded, reading in the data as it is encountered. Document#getField(String) and Document#getFieldable(String) should not return null. Document#add(Fieldable) should be called by the Reader.
SELECTOR_LAZY_LOAD | Lazily load this Field. This means the Field is valid, but it may not actually contain its data until invoked. Document#getField(String) SHOULD NOT BE USED. {} is safe to use and should return a valid instance of a { Fieldable}. Document#add(Fieldable)} should be called by the Reader.
SELECTOR_NO_LOAD | Do not load the Field. Document#getField(String) and {} should return null. Document#add(Fieldable)} is not called. Document#add(Fieldable)} should not be called by the Reader.
SELECTOR_LOAD_AND_BREAK | Load this field as in the LOAD case, but immediately return from Field loading for the Document. Thus, the Document may not have its complete set of Fields. {} and Document#getFieldable(String)} should both be valid for this Field} Document#add(Fieldable)} should be called by the Reader.
SELECTOR_SIZE | Load the size of this Field rather than its value. Size is measured as number of bytes required to store the field == bytes for a binary or any compressed value, and 2*chars for a String value. The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0].
SELECTOR_SIZE_AND_BREAK | Like SIZE but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded.

## Constructor & Destructor Documentation

## ◆ FieldSelector()

Lucene::FieldSelector::FieldSelector | ( |  | ) |

protected

## ◆ ~FieldSelector()

virtual Lucene::FieldSelector::~FieldSelector | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

static String Lucene::FieldSelector::_getClassName | ( |  | ) |

inline static

## ◆ accept()

virtual FieldSelectorResult Lucene::FieldSelector::accept | ( | const String & | fieldName | ) |

pure virtual

Implemented in Lucene::SetBasedFieldSelector, Lucene::MapFieldSelector, and Lucene::LoadFirstFieldSelector.

## ◆ getClassName()

virtual String Lucene::FieldSelector::getClassName | ( |  | ) |

inline virtual

Reimplemented in Lucene::SetBasedFieldSelector, Lucene::MapFieldSelector, and Lucene::LoadFirstFieldSelector.

## ◆ shared_from_this()

boost::shared_ptr< FieldSelector > Lucene::FieldSelector::shared_from_this | ( |  | ) |

inline

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

- FieldSelector.h

clucene.sourceforge.net