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


lucene::index::FieldInfos Class Reference

Access to the Field Info file that describes document fields and whether or not they are indexed. More...

#include <FieldInfos.h>

Inheritance diagram for lucene::index::FieldInfos:
lucene::debug::LuceneBase

List of all members.

Public Types

enum  {
  IS_INDEXED = 0x1, STORE_TERMVECTOR = 0x2, STORE_POSITIONS_WITH_TERMVECTOR = 0x4, STORE_OFFSET_WITH_TERMVECTOR = 0x8,
  OMIT_NORMS = 0x10
}

Public Member Functions

 FieldInfos ()
 ~FieldInfos ()
 FieldInfos (lucene::store::Directory *d, const char *name)
 Construct a FieldInfos object using the directory and the name of the file IndexInput.
int32_t fieldNumber (const TCHAR *fieldName) const
FieldInfofieldInfo (const TCHAR *fieldName) const
 Return the fieldinfo object referenced by the fieldNumber.
const TCHAR * fieldName (const int32_t fieldNumber) const
 Return the fieldName identified by its number.
FieldInfofieldInfo (const int32_t fieldNumber) const
int32_t size () const
bool hasVectors () const
void add (const lucene::document::Document *doc)
void add (FieldInfos *other)
void add (const TCHAR *name, const bool isIndexed, const bool storeTermVector=false, bool storePositionWithTermVector=false, bool storeOffsetWithTermVector=false, bool omitNorms=false)
 If the field is not yet known, adds it.
void add (const TCHAR **names, const bool isIndexed, const bool storeTermVector=false, bool storePositionWithTermVector=false, bool storeOffsetWithTermVector=false, bool omitNorms=false)
 Assumes the fields are not storing term vectors.
void write (lucene::store::Directory *d, const char *name) const
void write (lucene::store::IndexOutput *output) const

Detailed Description

Access to the Field Info file that describes document fields and whether or not they are indexed.

Each segment has a separate Field Info file. Objects of this class are thread-safe for multiple readers, but only one thread can be adding documents at a time, with no other reader or writer threads accessing this object.


Member Enumeration Documentation

anonymous enum
Enumerator:
IS_INDEXED 
STORE_TERMVECTOR 
STORE_POSITIONS_WITH_TERMVECTOR 
STORE_OFFSET_WITH_TERMVECTOR 
OMIT_NORMS 

Constructor & Destructor Documentation

lucene::index::FieldInfos::FieldInfos (  ) 
lucene::index::FieldInfos::~FieldInfos (  ) 
lucene::index::FieldInfos::FieldInfos ( lucene::store::Directory d,
const char *  name 
)

Construct a FieldInfos object using the directory and the name of the file IndexInput.

Parameters:
d The directory to open the IndexInput from
name The name of the file to open the IndexInput from in the Directory
Exceptions:
IOException 
See also:
read

Member Function Documentation

void lucene::index::FieldInfos::add ( const TCHAR **  names,
const bool  isIndexed,
const bool  storeTermVector = false,
bool  storePositionWithTermVector = false,
bool  storeOffsetWithTermVector = false,
bool  omitNorms = false 
)

Assumes the fields are not storing term vectors.

Parameters:
names The names of the fields
isIndexed true if the field is indexed
storeTermVector true if the term vector should be stored
See also:
add(String, boolean)
void lucene::index::FieldInfos::add ( const TCHAR *  name,
const bool  isIndexed,
const bool  storeTermVector = false,
bool  storePositionWithTermVector = false,
bool  storeOffsetWithTermVector = false,
bool  omitNorms = false 
)

If the field is not yet known, adds it.

If it is known, checks to make sure that the isIndexed flag is the same as was given previously for this field. If not - marks it as being indexed. Same goes for the TermVector parameters.

Parameters:
name The name of the field
isIndexed true if the field is indexed
storeTermVector true if the term vector should be stored
storePositionWithTermVector true if the term vector with positions should be stored
storeOffsetWithTermVector true if the term vector with offsets should be stored
void lucene::index::FieldInfos::add ( FieldInfos other  ) 
void lucene::index::FieldInfos::add ( const lucene::document::Document doc  ) 
FieldInfo* lucene::index::FieldInfos::fieldInfo ( const int32_t  fieldNumber  )  const
FieldInfo* lucene::index::FieldInfos::fieldInfo ( const TCHAR *  fieldName  )  const

Return the fieldinfo object referenced by the fieldNumber.

Parameters:
fieldNumber 
Returns:
the FieldInfo object or null when the given fieldNumber doesn't exist.
const TCHAR* lucene::index::FieldInfos::fieldName ( const int32_t  fieldNumber  )  const

Return the fieldName identified by its number.

Parameters:
fieldNumber 
Returns:
the fieldName or an empty string when the field with the given number doesn't exist.
int32_t lucene::index::FieldInfos::fieldNumber ( const TCHAR *  fieldName  )  const
bool lucene::index::FieldInfos::hasVectors (  )  const
int32_t lucene::index::FieldInfos::size (  )  const
void lucene::index::FieldInfos::write ( lucene::store::IndexOutput output  )  const
void lucene::index::FieldInfos::write ( lucene::store::Directory d,
const char *  name 
) const

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

clucene.sourceforge.net