Exemplo n.º 1
0
 /// <summary>
 /// Called during merging to merge all <seealso cref="Fields"/> from
 ///  sub-readers.  this must recurse to merge all postings
 ///  (terms, docs, positions, etc.).  A {@link
 ///  PostingsFormat} can override this default
 ///  implementation to do its own merging.
 /// </summary>
 public virtual void Merge(MergeState mergeState, Fields fields)
 {
     foreach (string field in fields)
     {
         FieldInfo info = mergeState.FieldInfos.FieldInfo(field);
         Debug.Assert(info != null, "FieldInfo for field is null: " + field);
         Terms terms = fields.GetTerms(field);
         if (terms != null)
         {
             TermsConsumer termsConsumer = AddField(info);
             termsConsumer.Merge(mergeState, info.IndexOptions, terms.GetIterator(null));
         }
     }
 }