Lucene++ - a full-featured, c++ search engine
API Documentation
Access to the Fieldable Info file that describes document fields and whether or not they are indexed. Each segment has a separate Fieldable 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. More...
#include <FieldInfos.h>
Public Member Functions | |
FieldInfos () | |
FieldInfos (const DirectoryPtr &d, const String &name) | |
Construct a FieldInfos object using the directory and the name of the file IndexInput. | |
virtual | ~FieldInfos () |
virtual String | getClassName () |
boost::shared_ptr< FieldInfos > | shared_from_this () |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Returns a deep clone of this FieldInfos instance. | |
void | add (const DocumentPtr &doc) |
Adds field info for a Document. | |
bool | hasProx () |
Returns true if any fields do not omitTermFreqAndPositions. | |
void | addIndexed (HashSet< String > names, bool storeTermVectors, bool storePositionWithTermVector, bool storeOffsetWithTermVector) |
Add fields that are indexed. Whether they have termvectors has to be specified. | |
void | add (HashSet< String > names, bool isIndexed) |
Assumes the fields are not storing term vectors. | |
void | add (const String &name, bool isIndexed) |
Calls 5 parameter add with false for all TermVector parameters. | |
void | add (const String &name, bool isIndexed, bool storeTermVector) |
Calls 5 parameter add with false for term vector positions and offsets. | |
void | add (const String &name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector) |
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. | |
void | add (const String &name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms) |
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. | |
FieldInfoPtr | add (const String &name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms, bool storePayloads, bool omitTermFreqAndPositions) |
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. | |
int32_t | fieldNumber (const String &fieldName) |
FieldInfoPtr | fieldInfo (const String &fieldName) |
String | fieldName (int32_t fieldNumber) |
Return the fieldName identified by its number. | |
FieldInfoPtr | fieldInfo (int32_t fieldNumber) |
Return the fieldinfo object referenced by the fieldNumber. | |
int32_t | size () |
bool | hasVectors () |
void | write (const DirectoryPtr &d, const String &name) |
void | write (const IndexOutputPtr &output) |
![]() | |
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. | |
![]() | |
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 () |
Static Public Attributes | |
static const int32_t | FORMAT_PRE |
static const int32_t | FORMAT_START |
static const int32_t | CURRENT_FORMAT |
static const uint8_t | IS_INDEXED |
static const uint8_t | STORE_TERMVECTOR |
static const uint8_t | STORE_POSITIONS_WITH_TERMVECTOR |
static const uint8_t | STORE_OFFSET_WITH_TERMVECTOR |
static const uint8_t | OMIT_NORMS |
static const uint8_t | STORE_PAYLOADS |
static const uint8_t | OMIT_TERM_FREQ_AND_POSITIONS |
Protected Member Functions | |
FieldInfoPtr | addInternal (const String &name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms, bool storePayloads, bool omitTermFreqAndPositions) |
void | read (const IndexInputPtr &input, const String &fileName) |
![]() | |
LuceneObject () | |
Protected Attributes | |
Collection< FieldInfoPtr > | byNumber |
MapStringFieldInfo | byName |
int32_t | format |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Access to the Fieldable Info file that describes document fields and whether or not they are indexed. Each segment has a separate Fieldable 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.
Lucene::FieldInfos::FieldInfos | ( | ) |
Lucene::FieldInfos::FieldInfos | ( | const DirectoryPtr & | d, |
const String & | name | ||
) |
Construct a FieldInfos object using the directory and the name of the file IndexInput.
d | The directory to open the IndexInput from |
name | The name of the file to open the IndexInput from in the Directory |
|
virtual |
|
inlinestatic |
void Lucene::FieldInfos::add | ( | const DocumentPtr & | doc | ) |
Adds field info for a Document.
void Lucene::FieldInfos::add | ( | const String & | name, |
bool | isIndexed | ||
) |
Calls 5 parameter add with false for all TermVector parameters.
name | The name of the Fieldable |
isIndexed | true if the field is indexed |
void Lucene::FieldInfos::add | ( | const String & | name, |
bool | isIndexed, | ||
bool | storeTermVector | ||
) |
Calls 5 parameter add with false for term vector positions and offsets.
name | The name of the field |
isIndexed | true if the field is indexed |
storeTermVector | true if the term vector should be stored |
void Lucene::FieldInfos::add | ( | const String & | name, |
bool | isIndexed, | ||
bool | storeTermVector, | ||
bool | storePositionWithTermVector, | ||
bool | storeOffsetWithTermVector | ||
) |
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.
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::FieldInfos::add | ( | const String & | name, |
bool | isIndexed, | ||
bool | storeTermVector, | ||
bool | storePositionWithTermVector, | ||
bool | storeOffsetWithTermVector, | ||
bool | omitNorms | ||
) |
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.
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 |
omitNorms | true if the norms for the indexed field should be omitted |
FieldInfoPtr Lucene::FieldInfos::add | ( | const String & | name, |
bool | isIndexed, | ||
bool | storeTermVector, | ||
bool | storePositionWithTermVector, | ||
bool | storeOffsetWithTermVector, | ||
bool | omitNorms, | ||
bool | storePayloads, | ||
bool | omitTermFreqAndPositions | ||
) |
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.
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 |
omitNorms | true if the norms for the indexed field should be omitted |
storePayloads | true if payloads should be stored for this field |
omitTermFreqAndPositions | true if term freqs should be omitted for this field |
void Lucene::FieldInfos::add | ( | HashSet< String > | names, |
bool | isIndexed | ||
) |
Assumes the fields are not storing term vectors.
names | The names of the fields |
isIndexed | Whether the fields are indexed or not |
void Lucene::FieldInfos::addIndexed | ( | HashSet< String > | names, |
bool | storeTermVectors, | ||
bool | storePositionWithTermVector, | ||
bool | storeOffsetWithTermVector | ||
) |
Add fields that are indexed. Whether they have termvectors has to be specified.
names | The names of the fields |
storeTermVectors | Whether the fields store term vectors or not |
storePositionWithTermVector | true if positions should be stored. |
storeOffsetWithTermVector | true if offsets should be stored |
|
protected |
|
virtual |
Returns a deep clone of this FieldInfos instance.
Reimplemented from Lucene::LuceneObject.
FieldInfoPtr Lucene::FieldInfos::fieldInfo | ( | const String & | fieldName | ) |
FieldInfoPtr Lucene::FieldInfos::fieldInfo | ( | int32_t | fieldNumber | ) |
Return the fieldinfo object referenced by the fieldNumber.
String Lucene::FieldInfos::fieldName | ( | int32_t | fieldNumber | ) |
Return the fieldName identified by its number.
int32_t Lucene::FieldInfos::fieldNumber | ( | const String & | fieldName | ) |
|
inlinevirtual |
bool Lucene::FieldInfos::hasProx | ( | ) |
Returns true if any fields do not omitTermFreqAndPositions.
bool Lucene::FieldInfos::hasVectors | ( | ) |
|
protected |
|
inline |
int32_t Lucene::FieldInfos::size | ( | ) |
void Lucene::FieldInfos::write | ( | const DirectoryPtr & | d, |
const String & | name | ||
) |
void Lucene::FieldInfos::write | ( | const IndexOutputPtr & | output | ) |
|
protected |
|
protected |
|
static |
|
protected |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |