Class GlobalOrdinalsIndexFieldData

java.lang.Object
org.elasticsearch.index.fielddata.ordinals.GlobalOrdinalsIndexFieldData
All Implemented Interfaces:
org.apache.lucene.util.Accountable, IndexFieldData<LeafOrdinalsFieldData>, IndexFieldData.Global<LeafOrdinalsFieldData>, IndexOrdinalsFieldData

public final class GlobalOrdinalsIndexFieldData extends Object implements IndexOrdinalsFieldData, org.apache.lucene.util.Accountable
Concrete implementation of IndexOrdinalsFieldData for global ordinals. A single instance of this class should be used to cache global ordinals per DirectoryReader. However loadGlobal(DirectoryReader) always creates a new instance of GlobalOrdinalsIndexFieldData.Consumer from the cached value in order to reuse the segment's TermsEnum that are needed to retrieve terms from global ordinals. Each instance of GlobalOrdinalsIndexFieldData.Consumer uses a new set of TermsEnum that can be reused during the collection, this is done to avoid creating all segment's TermsEnum each time we want to access the values of a single segment.