/// <summary> /// TODO: -- should we NOT reuse across fields? would /// be cleaner /// Currently, this instance is re-used across fields, so /// our parent calls setField whenever the field changes /// </summary> /// <param name="fieldInfo"></param> /// <returns></returns> public override int SetField(FieldInfo fieldInfo) { _indexOptions = fieldInfo.IndexOptions; _storePayloads = fieldInfo.HasPayloads; _absolute = false; _longsSize = _wrappedPostingsWriter.SetField(fieldInfo); _longs = new long[_longsSize]; _fields.Add(new FieldMetaData(fieldInfo.Number, _longsSize)); return(0); }
public TermsWriter( TermsIndexWriterBase.FieldWriter fieldIndexWriter, FieldInfo fieldInfo, PostingsWriterBase postingsWriter, BlockTermsWriter btw) { _fieldInfo = fieldInfo; _fieldIndexWriter = fieldIndexWriter; _btw = btw; _pendingTerms = new TermEntry[32]; for (int i = 0; i < _pendingTerms.Length; i++) { _pendingTerms[i] = new TermEntry(); } _termsStartPointer = _btw._output.FilePointer; _postingsWriter = postingsWriter; _longsSize = postingsWriter.SetField(fieldInfo); }
internal TermsWriter( BlockTermsWriter outerInstance, TermsIndexWriterBase.FieldWriter fieldIndexWriter, FieldInfo fieldInfo, PostingsWriterBase postingsWriter) { this.outerInstance = outerInstance; this.fieldInfo = fieldInfo; this.fieldIndexWriter = fieldIndexWriter; pendingTerms = new TermEntry[32]; for (int i = 0; i < pendingTerms.Length; i++) { pendingTerms[i] = new TermEntry(); } termsStartPointer = outerInstance.m_output.Position; // LUCENENET specific: Renamed from getFilePointer() to match FileStream this.postingsWriter = postingsWriter; this.longsSize = postingsWriter.SetField(fieldInfo); }
internal TermsWriter( BlockTermsWriter outerInstance, TermsIndexWriterBase.FieldWriter fieldIndexWriter, FieldInfo fieldInfo, PostingsWriterBase postingsWriter) { this.outerInstance = outerInstance; this.fieldInfo = fieldInfo; this.fieldIndexWriter = fieldIndexWriter; pendingTerms = new TermEntry[32]; for (int i = 0; i < pendingTerms.Length; i++) { pendingTerms[i] = new TermEntry(); } termsStartPointer = outerInstance.m_output.GetFilePointer(); this.postingsWriter = postingsWriter; this.longsSize = postingsWriter.SetField(fieldInfo); }