/// <summary>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. /// /// </summary> /// <param name="name">The name of the field /// </param> /// <param name="isIndexed">true if the field is indexed /// </param> /// <param name="storeTermVector">true if the term vector should be stored /// </param> /// <param name="storePositionWithTermVector">true if the term vector with positions should be stored /// </param> /// <param name="storeOffsetWithTermVector">true if the term vector with offsets should be stored /// </param> /// <param name="omitNorms">true if the norms for the indexed field should be omitted /// </param> /// <param name="storePayloads">true if payloads should be stored for this field /// </param> /// <param name="omitTermFreqAndPositions">true if term freqs should be omitted for this field /// </param> public FieldInfo Add(System.String name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms, bool storePayloads, bool omitTermFreqAndPositions) { lock (this) { FieldInfo fi = FieldInfo(name); if (fi == null) { return(AddInternal(name, isIndexed, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, omitNorms, storePayloads, omitTermFreqAndPositions)); } else { fi.Update(isIndexed, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, omitNorms, storePayloads, omitTermFreqAndPositions); } return(fi); } }