TermsEnum getTermsEnum() { try { return getTermsEnum(data.clone()); } catch (IOException e) { throw new RuntimeException(e); } }
public CompressedBinaryDocValues(BinaryEntry bytes, MonotonicBlockPackedReader addresses, ReverseTermsIndex index, IndexInput data) throws IOException { this.maxTermLength = bytes.maxLength; this.numValues = bytes.count; this.addresses = addresses; this.numIndexValues = addresses.size(); this.data = data; this.reverseTerms = index.terms; this.reverseAddresses = index.termAddresses; this.numReverseIndexValues = reverseAddresses.size(); this.termsEnum = getTermsEnum(data); }
@Override public TermsEnum termsEnum() { if (binary instanceof CompressedBinaryDocValues) { return ((CompressedBinaryDocValues)binary).getTermsEnum(); } else { return super.termsEnum(); } } };
@Override public long lookupTerm(BytesRef key) { if (binary instanceof CompressedBinaryDocValues) { return ((CompressedBinaryDocValues) binary).lookupTerm(key); } else { return super.lookupTerm(key); } }
@Override public int lookupTerm(BytesRef key) { if (binary instanceof CompressedBinaryDocValues) { return (int) ((CompressedBinaryDocValues)binary).lookupTerm(key); } else { return super.lookupTerm(key); } }
@Override public TermsEnum termsEnum() { if (binary instanceof CompressedBinaryDocValues) { return ((CompressedBinaryDocValues) binary).getTermsEnum(); } else { return super.termsEnum(); } }
@Override public long lookupTerm(BytesRef key) { if (binary instanceof CompressedBinaryDocValues) { return ((CompressedBinaryDocValues)binary).lookupTerm(key); } else { return super.lookupTerm(key); } }
@Override public TermsEnum termsEnum() { if (binary instanceof CompressedBinaryDocValues) { return ((CompressedBinaryDocValues)binary).getTermsEnum(); } else { return super.termsEnum(); } }
private BinaryDocValues getCompressedBinary(FieldInfo field, final BinaryEntry bytes) throws IOException { final MonotonicBlockPackedReader addresses = getIntervalInstance(field, bytes); final ReverseTermsIndex index = getReverseIndexInstance(field, bytes); assert addresses.size() > 0; // we don't have to handle empty case IndexInput slice = data.slice("terms", bytes.offset, bytes.addressesOffset - bytes.offset); return new CompressedBinaryDocValues(bytes, addresses, index, slice); }