public override SortedSetDocValues GetSortedSet(FieldInfo field) { SortedSetEntry ss = sortedSets[field.Number]; if (ss.Format == Lucene45DocValuesConsumer.SORTED_SET_SINGLE_VALUED_SORTED) { SortedDocValues values = GetSorted(field); return(DocValues.Singleton(values)); } else if (ss.Format != Lucene45DocValuesConsumer.SORTED_SET_WITH_ADDRESSES) { throw new Exception(); } IndexInput data = (IndexInput)this.data.Clone(); long valueCount = binaries[field.Number].Count; // we keep the byte[]s and list of ords on disk, these could be large Int64BinaryDocValues binary = (Int64BinaryDocValues)GetBinary(field); Int64Values ordinals = GetNumeric(ords[field.Number]); // but the addresses to the ord stream are in RAM MonotonicBlockPackedReader ordIndex = GetOrdIndexInstance(data, field, ordIndexes[field.Number]); return(new RandomAccessOrdsAnonymousInnerClassHelper(this, valueCount, binary, ordinals, ordIndex)); }