Exemple #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.Terms(field);
         if (terms != null)
         {
             TermsConsumer termsConsumer = AddField(info);
             termsConsumer.Merge(mergeState, info.FieldIndexOptions, terms.Iterator(null));
         }
     }
 }
Exemple #2
0
 public virtual void Merge(MergeState mergeState, Fields fields)
 {
     foreach (string field in fields)
     {
         FieldInfo info = mergeState.FieldInfos.FieldInfo(field);
         if (Debugging.AssertsEnabled)
         {
             Debugging.Assert(info != null, "FieldInfo for field is null: {0}", field);
         }
         Terms terms = fields.GetTerms(field);
         if (terms != null)
         {
             TermsConsumer termsConsumer = AddField(info);
             termsConsumer.Merge(mergeState, info.IndexOptions, terms.GetEnumerator());
         }
     }
 }