LongNumericDocValues getNumeric(NumericEntry entry) throws IOException { final IndexInput data = this.data.clone(); data.seek(entry.offset); final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true); return new LongNumericDocValues() { @Override public long get(long id) { return reader.get(id); } }; }
private LongNumericDocValues getNumeric(FieldInfo field, final NumericEntry entry) throws IOException { final IndexInput data = this.data.clone(); data.seek(entry.offset); final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true); return new LongNumericDocValues() { @Override public long get(long id) { return reader.get(id); } }; }
LongNumericDocValues newNumeric(NumericEntry entry) throws IOException { final IndexInput data = this.data.clone(); data.seek(entry.offset); final BlockPackedReader reader = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true); return new LongNumericDocValues() { @Override public long get(long id) { return reader.get(id); } }; }
@Override public SortedDocValues getSorted(FieldInfo field) throws IOException { final int valueCount = (int) binaries.get(field.number).count; final BinaryDocValues binary = getBinary(field); NumericEntry entry = ords.get(field.number); IndexInput data = this.data.clone(); data.seek(entry.offset); final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true); return new SortedDocValues() { @Override public int getOrd(int docID) { return (int) ordinals.get(docID); } @Override public BytesRef lookupOrd(int ord) { return binary.get(ord); } @Override public int getValueCount() { return valueCount; } @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 SortedDocValues getSorted(FieldInfo field) throws IOException { final int valueCount = (int) binaries.get(field.number).count; final BinaryDocValues binary = getBinary(field); NumericEntry entry = ords.get(field.number); IndexInput data = this.data.clone(); data.seek(entry.offset); final BlockPackedReader ordinals = new BlockPackedReader(data, entry.packedIntsVersion, entry.blockSize, entry.count, true); return new SortedDocValues() { @Override public int getOrd(int docID) { return (int) ordinals.get(docID); } @Override public void lookupOrd(int ord, BytesRef result) { binary.get(ord, result); } @Override public int getValueCount() { return valueCount; } @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(); } } }; }