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


Loading...
Searching...
No Matches
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 (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< FieldsReadershared_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< IndexInputfieldsStreamTL
 
bool isOriginal
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

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

Constructor & Destructor Documentation

◆ FieldsReader() [1/3]

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.

◆ FieldsReader() [2/3]

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

◆ FieldsReader() [3/3]

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

◆ ~FieldsReader()

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

Member Function Documentation

◆ _getClassName()

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

◆ addField()

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

◆ addFieldLazy()

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

◆ addFieldSize()

int32_t Lucene::FieldsReader::addFieldSize ( const DocumentPtr doc,
const 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.

◆ canReadRawDocs()

bool Lucene::FieldsReader::canReadRawDocs ( )

◆ clone()

virtual LuceneObjectPtr Lucene::FieldsReader::clone ( const 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.

◆ close()

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.

◆ ConstructReader()

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

◆ doc()

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

◆ ensureOpen()

void Lucene::FieldsReader::ensureOpen ( )
protected

◆ getClassName()

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

◆ rawDocs()

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.

◆ seekIndex()

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

◆ shared_from_this()

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

◆ size()

int32_t Lucene::FieldsReader::size ( )

◆ skipField() [1/2]

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.

◆ skipField() [2/2]

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

◆ uncompress()

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

◆ uncompressString()

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

Field Documentation

◆ _size

int32_t Lucene::FieldsReader::_size
protected

◆ cloneableFieldsStream

IndexInputPtr Lucene::FieldsReader::cloneableFieldsStream
protected

◆ cloneableIndexStream

IndexInputPtr Lucene::FieldsReader::cloneableIndexStream
protected

◆ closed

bool Lucene::FieldsReader::closed
protected

◆ docStoreOffset

int32_t Lucene::FieldsReader::docStoreOffset
protected

◆ fieldInfos

FieldInfosPtr Lucene::FieldsReader::fieldInfos
protected

◆ fieldsStream

IndexInputPtr Lucene::FieldsReader::fieldsStream
protected

◆ fieldsStreamTL

CloseableThreadLocal<IndexInput> Lucene::FieldsReader::fieldsStreamTL
protected

◆ format

int32_t Lucene::FieldsReader::format
protected

◆ formatSize

int32_t Lucene::FieldsReader::formatSize
protected

◆ indexStream

IndexInputPtr Lucene::FieldsReader::indexStream
protected

◆ isOriginal

bool Lucene::FieldsReader::isOriginal
protected

◆ numTotalDocs

int32_t Lucene::FieldsReader::numTotalDocs
protected

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

clucene.sourceforge.net