Example #1
0
 public FieldInfo Add(FieldInfo fieldInfo)
 {
     lock (this)
     {
         FieldInfo fi = FieldInfo(fieldInfo.name);
         if (fi == null)
         {
             return(AddInternal(fieldInfo.name, fieldInfo.isIndexed, fieldInfo.storeTermVector, fieldInfo.storePositionWithTermVector, fieldInfo.storeOffsetWithTermVector, fieldInfo.omitNorms, fieldInfo.storePayloads, fieldInfo.omitTf));
         }
         else
         {
             fi.update(fieldInfo);
         }
         return(fi);
     }
 }
Example #2
0
 /// <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>
 public FieldInfo Add(string name, bool isIndexed, bool storeTermVector, bool storePositionWithTermVector, bool storeOffsetWithTermVector, bool omitNorms, bool storePayloads, bool omitTf)
 {
     lock (this)
     {
         FieldInfo fi = FieldInfo(name);
         if (fi == null)
         {
             return(AddInternal(name, isIndexed, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, omitNorms, storePayloads, omitTf));
         }
         else
         {
             fi.update(isIndexed, storeTermVector, storePositionWithTermVector, storeOffsetWithTermVector, omitNorms, storePayloads, omitTf);
         }
         return(fi);
     }
 }