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


lucene::index::MultiReader Class Reference

#include <MultiReader.h>

Inheritance diagram for lucene::index::MultiReader:

lucene::index::IndexReader

Public Member Functions

 MultiReader (lucene::store::Directory *directory, SegmentInfos *sis, IndexReader **subReaders)
 Construct reading the named set of readers.
 MultiReader (IndexReader **subReaders)
 ~MultiReader ()
bool getTermFreqVectors (int32_t n, lucene::util::Array< TermFreqVector * > &result)
 Return an array of term frequency vectors for the specified document.
TermFreqVectorgetTermFreqVector (int32_t n, const TCHAR *field)
 Return a term frequency vector for the specified document and field.
int32_t numDocs ()
 Returns the number of documents in this index.
int32_t maxDoc () const
 Returns one greater than the largest possible document number.
bool document (int32_t n, lucene::document::Document *doc)
 Gets the stored fields of the nth Document in this index.
bool isDeleted (const int32_t n)
 Returns true if document n has been deleted.
bool hasDeletions () const
 Returns true if any documents have been deleted.
uint8_t * norms (const TCHAR *field)
 Returns the byte-encoded normalization factor for the named field of every document.
void norms (const TCHAR *field, uint8_t *result)
 Reads the byte-encoded normalization factor for the named field of every document.
TermEnumterms () const
 Returns an enumeration of all the terms in the index.
TermEnumterms (const Term *term) const
 Returns an enumeration of all terms after a given term.
int32_t docFreq (const Term *t=NULL) const
 Returns the number of documents containing the term t.
TermDocstermDocs () const
 Returns an unpositioned TermDocs enumerator.
TermPositionstermPositions () const
void getFieldNames (FieldOption fldOption, StringArrayWithDeletor &retarray)

Protected Member Functions

void doSetNorm (int32_t n, const TCHAR *field, uint8_t value)
 Implements setNorm in subclass.
void doUndeleteAll ()
 Implements actual undeleteAll() in subclass.
void doCommit ()
 Internal use.
void doClose ()
 Implements close.
void doDelete (const int32_t n)
 Implements deletion of the document numbered docNum.

Constructor & Destructor Documentation

lucene::index::MultiReader::MultiReader ( lucene::store::Directory directory,
SegmentInfos *  sis,
IndexReader **  subReaders 
)

Construct reading the named set of readers.

lucene::index::MultiReader::MultiReader ( IndexReader **  subReaders  ) 

Construct a MultiReader aggregating the named set of (sub)readers. Directory locking for delete, undeleteAll, and setNorm operations is left to the subreaders.

Note that all subreaders are closed if this Multireader is closed.

Parameters:
subReaders set of (sub)readers
Exceptions:
IOException 

lucene::index::MultiReader::~MultiReader (  ) 


Member Function Documentation

void lucene::index::MultiReader::doSetNorm ( int32_t  doc,
const TCHAR *  field,
uint8_t  value 
) [protected, virtual]

Implements setNorm in subclass.

Implements lucene::index::IndexReader.

void lucene::index::MultiReader::doUndeleteAll (  )  [protected, virtual]

Implements actual undeleteAll() in subclass.

Implements lucene::index::IndexReader.

void lucene::index::MultiReader::doCommit (  )  [protected, virtual]

Internal use.

Implements commit

Implements lucene::index::IndexReader.

void lucene::index::MultiReader::doClose (  )  [protected, virtual]

Implements close.

Implements lucene::index::IndexReader.

void lucene::index::MultiReader::doDelete ( const int32_t  docNum  )  [protected, virtual]

Implements deletion of the document numbered docNum.

Applications should call deleteDocument(int32_t) or deleteDocuments(Term*).

Implements lucene::index::IndexReader.

bool lucene::index::MultiReader::getTermFreqVectors ( int32_t  n,
lucene::util::Array< TermFreqVector * > &  result 
) [virtual]

Return an array of term frequency vectors for the specified document.

The array contains a vector for each vectorized field in the document. Each vector vector contains term numbers and frequencies for all terms in a given vectorized field. If no such fields existed, the method returns null.

Implements lucene::index::IndexReader.

TermFreqVector* lucene::index::MultiReader::getTermFreqVector ( int32_t  docNumber,
const TCHAR *  field 
) [virtual]

Return a term frequency vector for the specified document and field.

The returned vector contains terms and frequencies for the terms in the specified field of this document, if the field had the storeTermVector flag set. If termvectors had been stored with positions or offsets, a TermPositionsVector is returned.

Parameters:
docNumber document for which the term frequency vector is returned
field field for which the term frequency vector is returned.
Returns:
term frequency vector May be null if field does not exist in the specified document or term vector was not stored.
Exceptions:
IOException if index cannot be accessed
See also:
org.apache.lucene.document.Field.TermVector

Implements lucene::index::IndexReader.

int32_t lucene::index::MultiReader::numDocs (  )  [virtual]

Returns the number of documents in this index.

Implements lucene::index::IndexReader.

int32_t lucene::index::MultiReader::maxDoc (  )  const [virtual]

Returns one greater than the largest possible document number.

This may be used to, e.g., determine how big to allocate an array which will have an element for every document number in an index.

Implements lucene::index::IndexReader.

bool lucene::index::MultiReader::document ( int32_t  n,
lucene::document::Document  
) [virtual]

Gets the stored fields of the nth Document in this index.

The fields are not cleared before retrieving the document, so the object should be new or just cleared.

Implements lucene::index::IndexReader.

bool lucene::index::MultiReader::isDeleted ( const int32_t  n  )  [virtual]

Returns true if document n has been deleted.

Implements lucene::index::IndexReader.

bool lucene::index::MultiReader::hasDeletions (  )  const [virtual]

Returns true if any documents have been deleted.

Implements lucene::index::IndexReader.

uint8_t* lucene::index::MultiReader::norms ( const TCHAR *  field  )  [virtual]

Returns the byte-encoded normalization factor for the named field of every document.

This is used by the search code to score documents.

The number of bytes returned is the size of the IndexReader->maxDoc() MEMORY: The values are cached, so don't delete the returned byte array.

See also:
Field::setBoost(float_t)

Implements lucene::index::IndexReader.

void lucene::index::MultiReader::norms ( const TCHAR *  field,
uint8_t *  bytes 
) [virtual]

Reads the byte-encoded normalization factor for the named field of every document.

This is used by the search code to score documents.

See also:
Field::setBoost(float_t)

Implements lucene::index::IndexReader.

TermEnum* lucene::index::MultiReader::terms (  )  const [virtual]

Returns an enumeration of all the terms in the index.

The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration.

Memory management:
Caller must clean up

Implements lucene::index::IndexReader.

TermEnum* lucene::index::MultiReader::terms ( const Term t  )  const [virtual]

Returns an enumeration of all terms after a given term.

The enumeration is ordered by Term.compareTo(). Each term is greater than all that precede it in the enumeration.

Memory management:
Caller must clean up

Implements lucene::index::IndexReader.

int32_t lucene::index::MultiReader::docFreq ( const Term t = NULL  )  const [virtual]

Returns the number of documents containing the term t.

Implements lucene::index::IndexReader.

TermDocs* lucene::index::MultiReader::termDocs (  )  const [virtual]

Returns an unpositioned TermDocs enumerator.

Memory management:
Caller must clean up

Implements lucene::index::IndexReader.

TermPositions* lucene::index::MultiReader::termPositions (  )  const [virtual]

void lucene::index::MultiReader::getFieldNames ( FieldOption  fldOption,
StringArrayWithDeletor &  retarray 
) [virtual]


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

clucene.sourceforge.net