public MultiTerms(Terms[] subs, ReaderSlice[] subSlices) throws IOException { this.subs = subs;this.subSlices = subSlices;assert subs.length > 0 : "inefficient: don't use MultiTerms over one sub";boolean _hasFreqs = true;boolean _hasOffsets = true;boolean _hasPositions = true;boolean _hasPayloads = false;for(int i=0;i<subs.length;i++) {_hasFreqs &= subs[i].hasFreqs();_hasOffsets &= subs[i].hasOffsets();_hasPositions &= subs[i].hasPositions();_hasPayloads |= subs[i].hasPayloads();}hasFreqs = _hasFreqs;hasOffsets = _hasOffsets;hasPositions = _hasPositions;hasPayloads = hasPositions && _hasPayloads; }
public MultiTerms(Terms[] subs, ReaderSlice[] subSlices){this.subs = subs;this.subSlices = subSlices;IComparer<BytesRef> _termComp = null;Debug.Assert(subs.Length > 0, "inefficient: don't use MultiTerms over one sub");bool _hasFreqs = true;bool _hasOffsets = true;bool _hasPositions = true;bool _hasPayloads = false;for (int i = 0; i < subs.Length; i++){if (_termComp == null){_termComp = subs[i].Comparer;}else{IComparer<BytesRef> subTermComp = subs[i].Comparer;if (subTermComp != null && !subTermComp.Equals(_termComp)){throw new InvalidOperationException("sub-readers have different BytesRef.Comparers; cannot merge");}}_hasFreqs &= subs[i].HasFreqs;_hasOffsets &= subs[i].HasOffsets;_hasPositions &= subs[i].HasPositions;_hasPayloads |= subs[i].HasPayloads;}termComp = _termComp;hasFreqs = _hasFreqs;hasOffsets = _hasOffsets;hasPositions = _hasPositions;hasPayloads = hasPositions && _hasPayloads; }