@Override public boolean hasFreqs() { return in.hasFreqs(); }
/** Sole constructor. * * @param subs The {@link Terms} instances of all sub-readers. * @param subSlices A parallel array (matching {@code * subs}) describing the sub-reader slices. */ 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; // if all subs have pos, and at least one has payloads. }
final boolean hasFreqs = terms.hasFreqs(); final boolean hasPositions = terms.hasPositions(); final boolean hasPayloads = terms.hasPayloads();
@Override public boolean hasFreqs() { return in.hasFreqs(); }
@Override public boolean hasFreqs() { return delegateTerms.hasFreqs(); }
@Override public boolean hasFreqs() { return in.hasFreqs(); }
@Override public boolean hasFreqs() { return in.hasFreqs(); }
/** Sole constructor. * * @param subs The {@link Terms} instances of all sub-readers. * @param subSlices A parallel array (matching {@code * subs}) describing the sub-reader slices. */ 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; // if all subs have pos, and at least one has payloads. }
/** Sole constructor. * * @param subs The {@link Terms} instances of all sub-readers. * @param subSlices A parallel array (matching {@code * subs}) describing the sub-reader slices. */ 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; // if all subs have pos, and at least one has payloads. }
/** Sole constructor. * * @param subs The {@link Terms} instances of all sub-readers. * @param subSlices A parallel array (matching {@code * subs}) describing the sub-reader slices. */ 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; // if all subs have pos, and at least one has payloads. }
/** * Constructor. The uninversion doesn't happen here; it's delayed till the first call to * {@link #incrementToken}. * * @param vector Terms that contains the data for * creating the TokenStream. Must have positions and/or offsets. * @param maxStartOffset if a token's start offset exceeds this then the token is not added. -1 disables the limit. */ public TokenStreamFromTermVector(Terms vector, int maxStartOffset) throws IOException { super(ATTRIBUTE_FACTORY); this.maxStartOffset = maxStartOffset < 0 ? Integer.MAX_VALUE : maxStartOffset; assert !hasAttribute(PayloadAttribute.class) : "AttributeFactory shouldn't have payloads *yet*"; if (!vector.hasPositions() && !vector.hasOffsets()) { throw new IllegalArgumentException("The term vector needs positions and/or offsets."); } assert vector.hasFreqs(); this.vector = vector; termAttribute = addAttribute(CharTermAttribute.class); positionIncrementAttribute = addAttribute(PositionIncrementAttribute.class); }
if (!terms.hasFreqs()) { indexOptions = IndexOptions.DOCS; } else if (!terms.hasPositions()) {
final boolean hasFreqs = terms.hasFreqs(); final boolean hasPositions = terms.hasPositions(); final boolean hasPayloads = terms.hasPayloads();
final boolean hasFreqs = terms.hasFreqs(); final boolean hasPositions = terms.hasPositions(); final boolean hasPayloads = terms.hasPayloads();
final boolean hasFreqs = terms.hasFreqs(); final boolean hasPositions = terms.hasPositions(); final boolean hasPayloads = terms.hasPayloads();
boolean hasFreqs = terms.hasFreqs(); boolean hasPayloads = fieldInfo.hasPayloads(); boolean hasOffsets = terms.hasOffsets();