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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

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

Class responsible for access to stored document fields. It uses <segment>.fdt and <segment>.fdx; files. More...

`#include <FieldsReader.h>`

Inheritance diagram for Lucene::FieldsReader:

## Public Member Functions

| FieldsReader (FieldInfosPtr fieldInfos, int32_t numTotalDocs, int32_t size, int32_t format, int32_t formatSize, int32_t docStoreOffset, IndexInputPtr cloneableFieldsStream, IndexInputPtr cloneableIndexStream)
| Used only by clone. More...
| FieldsReader (DirectoryPtr d, const String &segment, FieldInfosPtr fn)
| FieldsReader (DirectoryPtr d, const String &segment, FieldInfosPtr fn, int32_t readBufferSize, int32_t docStoreOffset=-1, int32_t size=0)
virtual | ~FieldsReader ()
virtual String | getClassName ()
boost::shared_ptr< FieldsReader > | shared_from_this ()
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Returns a cloned FieldsReader that shares open IndexInputs with the original one. It is the caller's job not to close the original FieldsReader until all clones are called (eg, currently SegmentReader manages this logic). More...
void | close ()
| Closes the underlying IndexInput streams, including any ones associated with a lazy implementation of a Field. This means that the Fields values will not be accessible. More...
int32_t | size ()
bool | canReadRawDocs ()
DocumentPtr | doc (int32_t n, FieldSelectorPtr fieldSelector)
IndexInputPtr | rawDocs (Collection< int32_t > lengths, int32_t startDocID, int32_t numDocs)
| Returns the length in bytes of each raw document in a contiguous range of length numDocs starting with startDocID. Returns the IndexInput (the fieldStream), already seeked to the starting point for startDocID. 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 int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (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

void | ConstructReader (DirectoryPtr d, const String &segment, FieldInfosPtr fn, int32_t readBufferSize, int32_t docStoreOffset, int32_t size)
void | ensureOpen ()
void | seekIndex (int32_t docID)
void | skipField (bool binary, bool compressed)
| Skip the field. We still have to read some of the information about the field, but can skip past the actual content. This will have the most payoff on large fields. More...
void | skipField (bool binary, bool compressed, int32_t toRead)
void | addFieldLazy (DocumentPtr doc, FieldInfoPtr fi, bool binary, bool compressed, bool tokenize)
void | addField (DocumentPtr doc, FieldInfoPtr fi, bool binary, bool compressed, bool tokenize)
int32_t | addFieldSize (DocumentPtr doc, FieldInfoPtr fi, bool binary, bool compressed)
| Add the size of field as a byte[] containing the 4 bytes of the integer byte size (high order byte first; char = 2 bytes). Read just the size - caller must skip the field content to continue reading fields. Return the size in bytes or chars, depending on field type. More...
ByteArray | uncompress (ByteArray b)
String | uncompressString (ByteArray b)
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Protected Attributes

FieldInfosPtr | fieldInfos
IndexInputPtr | cloneableFieldsStream
IndexInputPtr | fieldsStream
IndexInputPtr | cloneableIndexStream
IndexInputPtr | indexStream
int32_t | numTotalDocs
int32_t | _size
bool | closed
int32_t | format
int32_t | formatSize
int32_t | docStoreOffset
CloseableThreadLocal< IndexInput > | fieldsStreamTL
bool | isOriginal

## Detailed Description

Class responsible for access to stored document fields. It uses <segment>.fdt and <segment>.fdx; files.

## Constructor & Destructor Documentation

Lucene::FieldsReader::FieldsReader | ( | FieldInfosPtr | fieldInfos,
|  | int32_t | numTotalDocs,
|  | int32_t | size,
|  | int32_t | format,
|  | int32_t | formatSize,
|  | int32_t | docStoreOffset,
|  | IndexInputPtr | cloneableFieldsStream,
|  | IndexInputPtr | cloneableIndexStream
| ) |  |

Used only by clone.

Lucene::FieldsReader::FieldsReader | ( | DirectoryPtr | d,
|  | const String & | segment,
|  | FieldInfosPtr | fn
| ) |  |

Lucene::FieldsReader::FieldsReader | ( | DirectoryPtr | d,
|  | const String & | segment,
|  | FieldInfosPtr | fn,
|  | int32_t | readBufferSize,
|  | int32_t | docStoreOffset = `-1`,
|  | int32_t | size = `0`
| ) |  |

virtual Lucene::FieldsReader::~FieldsReader | ( | ) |  |

virtual

## Member Function Documentation

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

inline static

void Lucene::FieldsReader::addField | ( | DocumentPtr | doc,
|  | FieldInfoPtr | fi,
|  | bool | binary,
|  | bool | compressed,
|  | bool | tokenize
| ) |  |

protected

void Lucene::FieldsReader::addFieldLazy | ( | DocumentPtr | doc,
|  | FieldInfoPtr | fi,
|  | bool | binary,
|  | bool | compressed,
|  | bool | tokenize
| ) |  |

protected

int32_t Lucene::FieldsReader::addFieldSize | ( | DocumentPtr | doc,
|  | FieldInfoPtr | fi,
|  | bool | binary,
|  | bool | compressed
| ) |  |

protected

Add the size of field as a byte[] containing the 4 bytes of the integer byte size (high order byte first; char = 2 bytes). Read just the size - caller must skip the field content to continue reading fields. Return the size in bytes or chars, depending on field type.

bool Lucene::FieldsReader::canReadRawDocs | ( | ) |  |

virtual LuceneObjectPtr Lucene::FieldsReader::clone | ( | LuceneObjectPtr | other = `LuceneObjectPtr()`) |  |

virtual

Returns a cloned FieldsReader that shares open IndexInputs with the original one. It is the caller's job not to close the original FieldsReader until all clones are called (eg, currently SegmentReader manages this logic).

Reimplemented from Lucene::LuceneObject.

void Lucene::FieldsReader::close | ( | ) |  |

Closes the underlying IndexInput streams, including any ones associated with a lazy implementation of a Field. This means that the Fields values will not be accessible.

void Lucene::FieldsReader::ConstructReader | ( | DirectoryPtr | d,
|  | const String & | segment,
|  | FieldInfosPtr | fn,
|  | int32_t | readBufferSize,
|  | int32_t | docStoreOffset,
|  | int32_t | size
| ) |  |

protected

DocumentPtr Lucene::FieldsReader::doc | ( | int32_t | n,
|  | FieldSelectorPtr | fieldSelector
| ) |  |

void Lucene::FieldsReader::ensureOpen | ( | ) |  |

protected

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

inline virtual

IndexInputPtr Lucene::FieldsReader::rawDocs | ( | Collection< int32_t > | lengths,
|  | int32_t | startDocID,
|  | int32_t | numDocs
| ) |  |

Returns the length in bytes of each raw document in a contiguous range of length numDocs starting with startDocID. Returns the IndexInput (the fieldStream), already seeked to the starting point for startDocID.

void Lucene::FieldsReader::seekIndex | ( | int32_t | docID) |  |

protected

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

inline

int32_t Lucene::FieldsReader::size | ( | ) |  |

void Lucene::FieldsReader::skipField | ( | bool | binary,
|  | bool | compressed
| ) |  |

protected

Skip the field. We still have to read some of the information about the field, but can skip past the actual content. This will have the most payoff on large fields.

void Lucene::FieldsReader::skipField | ( | bool | binary,
|  | bool | compressed,
|  | int32_t | toRead
| ) |  |

protected

ByteArray Lucene::FieldsReader::uncompress | ( | ByteArray | b) |  |

protected

String Lucene::FieldsReader::uncompressString | ( | ByteArray | b) |  |

protected

## Field Documentation

int32_t Lucene::FieldsReader::_size

protected

IndexInputPtr Lucene::FieldsReader::cloneableFieldsStream

protected

IndexInputPtr Lucene::FieldsReader::cloneableIndexStream

protected

bool Lucene::FieldsReader::closed

protected

int32_t Lucene::FieldsReader::docStoreOffset

protected

FieldInfosPtr Lucene::FieldsReader::fieldInfos

protected

IndexInputPtr Lucene::FieldsReader::fieldsStream

protected

CloseableThreadLocal<IndexInput> Lucene::FieldsReader::fieldsStreamTL

protected

int32_t Lucene::FieldsReader::format

protected

int32_t Lucene::FieldsReader::formatSize

protected

IndexInputPtr Lucene::FieldsReader::indexStream

protected

bool Lucene::FieldsReader::isOriginal

protected

int32_t Lucene::FieldsReader::numTotalDocs

protected

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

- FieldsReader.h

clucene.sourceforge.net