20 namespace Lucene.Net.Index
33 internal bool primary;
37 internal int freePostingsCount;
41 docState = docInverterPerThread.docState;
43 this.termsHash = termsHash;
44 this.consumer = termsHash.consumer.
AddThread(
this);
46 if (nextTermsHash != null)
54 charPool = primaryPerThread.charPool;
58 intPool =
new IntBlockPool(termsHash.docWriter, termsHash.trackAllocations);
59 bytePool =
new ByteBlockPool(termsHash.docWriter.byteBlockAllocator, termsHash.trackAllocations);
61 if (nextTermsHash != null)
62 nextPerThread = nextTermsHash.AddThread(docInverterPerThread,
this);
69 return new TermsHashPerField(docInverterPerField,
this, nextPerThread, fieldInfo);
72 public override void Abort()
78 if (nextPerThread != null)
79 nextPerThread.Abort();
84 internal void MorePostings()
86 System.Diagnostics.Debug.Assert(freePostingsCount == 0);
87 termsHash.GetPostings(freePostings);
88 freePostingsCount = freePostings.Length;
89 System.Diagnostics.Debug.Assert(noNullPostings(freePostings, freePostingsCount,
"consumer=" + consumer));
92 private static bool noNullPostings(RawPostingList[] postings,
int count, System.String details)
94 for (
int i = 0; i < count; i++)
95 System.Diagnostics.Debug.Assert(postings[i] != null,
"postings[" + i +
"] of " + count +
" is null: " + details);
99 public override void StartDocument()
101 consumer.StartDocument();
102 if (nextPerThread != null)
103 nextPerThread.consumer.StartDocument();
111 if (nextPerThread != null)
112 doc2 = nextPerThread.consumer.FinishDocument();
125 internal void Reset(
bool recyclePostings)
135 termsHash.RecyclePostings(freePostings, freePostingsCount);
136 freePostingsCount = 0;