internal virtual SepDocsAndPositionsEnum Init(FieldInfo fieldInfo, SepTermState termState, Bits liveDocs) { _liveDocs = liveDocs; _storePayloads = fieldInfo.HasPayloads(); // TODO: can't we only do this if consumer skipped consuming the previous docs? _docIndex.CopyFrom(termState.DOC_INDEX); _docIndex.Seek(_docReader); _freqIndex.CopyFrom(termState.FREQ_INDEX); _freqIndex.Seek(_freqReader); _posIndex.CopyFrom(termState.POS_INDEX); _posSeekPending = true; _payloadPending = false; _payloadFp = termState.PAYLOAD_FP; _skipFp = termState.SKIP_FP; _docFreq = termState.DocFreq; _count = 0; _doc = -1; _accum = 0; _pendingPosCount = 0; _pendingPayloadBytes = 0; _skipped = false; return(this); }
internal virtual SepDocsEnum Init(FieldInfo fieldInfo, SepTermState termState, Bits liveDocs) { _liveDocs = liveDocs; if (fieldInfo.FieldIndexOptions.HasValue) { _indexOptions = fieldInfo.FieldIndexOptions.Value; } _omitTf = _indexOptions == FieldInfo.IndexOptions.DOCS_ONLY; _storePayloads = fieldInfo.HasPayloads(); // TODO: can't we only do this if consumer // skipped consuming the previous docs? _docIndex.CopyFrom(termState.DOC_INDEX); _docIndex.Seek(_docReader); if (!_omitTf) { _freqIndex.CopyFrom(termState.FREQ_INDEX); _freqIndex.Seek(_freqReader); } _docFreq = termState.DocFreq; // NOTE: unused if docFreq < skipMinimum: _skipFp = termState.SKIP_FP; _count = 0; _doc = -1; _accum = 0; _freq = 1; _skipped = false; return(this); }
public override void CopyFrom(TermState tsOther) { base.CopyFrom(tsOther); var other = (SepTermState)tsOther; if (DOC_INDEX == null) { DOC_INDEX = other.DOC_INDEX.Clone(); } else { DOC_INDEX.CopyFrom(other.DOC_INDEX); } if (other.FREQ_INDEX != null) { if (FREQ_INDEX == null) { FREQ_INDEX = other.FREQ_INDEX.Clone(); } else { FREQ_INDEX.CopyFrom(other.FREQ_INDEX); } } else { FREQ_INDEX = null; } if (other.POS_INDEX != null) { if (POS_INDEX == null) { POS_INDEX = other.POS_INDEX.Clone(); } else { POS_INDEX.CopyFrom(other.POS_INDEX); } } else { POS_INDEX = null; } PAYLOAD_FP = other.PAYLOAD_FP; SKIP_FP = other.SKIP_FP; }