Lucene++ - a full-featured, c++ search engine
API Documentation
Class responsible for access to stored document fields. It uses <segment>.fdt and <segment>.fdx; files. More...
#include <FieldsReader.h>
Public Member Functions | |
| FieldsReader (const FieldInfosPtr &fieldInfos, int32_t numTotalDocs, int32_t size, int32_t format, int32_t formatSize, int32_t docStoreOffset, const IndexInputPtr &cloneableFieldsStream, const IndexInputPtr &cloneableIndexStream) | |
| Used only by clone. | |
| FieldsReader (const DirectoryPtr &d, const String &segment, const FieldInfosPtr &fn) | |
| FieldsReader (const DirectoryPtr &d, const String &segment, const 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 (const 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). | |
| 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. | |
| int32_t | size () |
| bool | canReadRawDocs () |
| DocumentPtr | doc (int32_t n, const 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. | |
| 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. | |
| virtual int32_t | hashCode () |
| Return hash code for this object. | |
| virtual bool | equals (const LuceneObjectPtr &other) |
| Return whether two objects are equal. | |
| virtual int32_t | compareTo (const LuceneObjectPtr &other) |
| Compare two objects. | |
| virtual String | toString () |
| Returns a string representation of the object. | |
| Public Member Functions inherited from Lucene::LuceneSync | |
| 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 () |
Protected Member Functions | |
| void | ConstructReader (const DirectoryPtr &d, const String &segment, const 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. | |
| void | skipField (bool binary, bool compressed, int32_t toRead) |
| void | addFieldLazy (const DocumentPtr &doc, const FieldInfoPtr &fi, bool binary, bool compressed, bool tokenize) |
| void | addField (const DocumentPtr &doc, const FieldInfoPtr &fi, bool binary, bool compressed, bool tokenize) |
| int32_t | addFieldSize (const DocumentPtr &doc, const 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. | |
| 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 |
| Protected Attributes inherited from Lucene::LuceneSync | |
| SynchronizePtr | objectLock |
| LuceneSignalPtr | objectSignal |
Class responsible for access to stored document fields. It uses <segment>.fdt and <segment>.fdx; files.
| Lucene::FieldsReader::FieldsReader | ( | const FieldInfosPtr & | fieldInfos, |
| int32_t | numTotalDocs, | ||
| int32_t | size, | ||
| int32_t | format, | ||
| int32_t | formatSize, | ||
| int32_t | docStoreOffset, | ||
| const IndexInputPtr & | cloneableFieldsStream, | ||
| const IndexInputPtr & | cloneableIndexStream ) |
Used only by clone.
References cloneableFieldsStream, cloneableIndexStream, docStoreOffset, fieldInfos, format, formatSize, numTotalDocs, and size().
Referenced by _getClassName().
| Lucene::FieldsReader::FieldsReader | ( | const DirectoryPtr & | d, |
| const String & | segment, | ||
| const FieldInfosPtr & | fn ) |
| Lucene::FieldsReader::FieldsReader | ( | const DirectoryPtr & | d, |
| const String & | segment, | ||
| const FieldInfosPtr & | fn, | ||
| int32_t | readBufferSize, | ||
| int32_t | docStoreOffset = -1, | ||
| int32_t | size = 0 ) |
References docStoreOffset, and size().
|
virtual |
|
inlinestatic |
References FieldsReader().
|
protected |
References doc().
|
protected |
References doc().
|
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.
References doc().
| bool Lucene::FieldsReader::canReadRawDocs | ( | ) |
|
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.
|
protected |
References docStoreOffset, and size().
| DocumentPtr Lucene::FieldsReader::doc | ( | int32_t | n, |
| const FieldSelectorPtr & | fieldSelector ) |
Referenced by addField(), addFieldLazy(), and addFieldSize().
|
protected |
|
inlinevirtual |
| 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.
|
protected |
|
inline |
| int32_t Lucene::FieldsReader::size | ( | ) |
Referenced by ConstructReader(), FieldsReader(), and FieldsReader().
|
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.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by FieldsReader().
|
protected |
Referenced by FieldsReader().
|
protected |
|
protected |
Referenced by ConstructReader(), FieldsReader(), and FieldsReader().
|
protected |
Referenced by FieldsReader().
|
protected |
|
protected |
|
protected |
Referenced by FieldsReader().
|
protected |
Referenced by FieldsReader().
|
protected |
|
protected |
|
protected |
Referenced by FieldsReader().