Class AbstractIndexOrdinalsFieldData
java.lang.Object
org.elasticsearch.index.fielddata.plain.AbstractIndexOrdinalsFieldData
- All Implemented Interfaces:
IndexFieldData<LeafOrdinalsFieldData>,IndexFieldData.Global<LeafOrdinalsFieldData>,IndexOrdinalsFieldData
- Direct Known Subclasses:
ConstantIndexFieldData,PagedBytesIndexFieldData,SortedSetOrdinalsIndexFieldData
public abstract class AbstractIndexOrdinalsFieldData extends java.lang.Object implements IndexOrdinalsFieldData
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAbstractIndexOrdinalsFieldData.PerValueEstimatorAPerValueEstimatoris a sub-class that can be used to estimate the memory overhead for loading the data.Nested classes/interfaces inherited from interface org.elasticsearch.index.fielddata.IndexFieldData
IndexFieldData.Builder, IndexFieldData.Global<FD extends LeafFieldData>, IndexFieldData.XFieldComparatorSource -
Field Summary
Fields Modifier and Type Field Description protected CircuitBreakerServicebreakerServiceprotected java.util.function.Function<org.apache.lucene.index.SortedSetDocValues,ScriptDocValues<?>>scriptFunction -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIndexOrdinalsFieldData(java.lang.String fieldName, ValuesSourceType valuesSourceType, IndexFieldDataCache cache, CircuitBreakerService breakerService, java.util.function.Function<org.apache.lucene.index.SortedSetDocValues,ScriptDocValues<?>> scriptFunction) -
Method Summary
Modifier and Type Method Description java.lang.StringgetFieldName()The field name.org.apache.lucene.index.OrdinalMapgetOrdinalMap()Returns the underlyingOrdinalMapfor this fielddata or null if global ordinals are not needed (constant value or single segment).ValuesSourceTypegetValuesSourceType()The ValuesSourceType of the underlying data.LeafOrdinalsFieldDataload(org.apache.lucene.index.LeafReaderContext context)Loads the atomic field data for the reader, possibly cached.IndexOrdinalsFieldDataloadGlobal(org.apache.lucene.index.DirectoryReader indexReader)Load a global view of the ordinals for the givenIndexReader, potentially from a cache.IndexOrdinalsFieldDataloadGlobalDirect(org.apache.lucene.index.DirectoryReader indexReader)Load a global view of the ordinals for the givenIndexReader.booleansupportsGlobalOrdinalsMapping()Whether this field data is able to provide a mapping between global and segment ordinals, by returning the underlyingOrdinalMap.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.index.fielddata.IndexFieldData
loadDirect, newBucketedSort, sortField
-
Field Details
-
breakerService
-
scriptFunction
protected final java.util.function.Function<org.apache.lucene.index.SortedSetDocValues,ScriptDocValues<?>> scriptFunction
-
-
Constructor Details
-
AbstractIndexOrdinalsFieldData
protected AbstractIndexOrdinalsFieldData(java.lang.String fieldName, ValuesSourceType valuesSourceType, IndexFieldDataCache cache, CircuitBreakerService breakerService, java.util.function.Function<org.apache.lucene.index.SortedSetDocValues,ScriptDocValues<?>> scriptFunction)
-
-
Method Details
-
getFieldName
public java.lang.String getFieldName()Description copied from interface:IndexFieldDataThe field name.- Specified by:
getFieldNamein interfaceIndexFieldData<LeafOrdinalsFieldData>
-
getValuesSourceType
Description copied from interface:IndexFieldDataThe ValuesSourceType of the underlying data. It's possible for fields that use the same IndexFieldData implementation to have different ValuesSourceTypes, such as in the case of Longs and Dates.- Specified by:
getValuesSourceTypein interfaceIndexFieldData<LeafOrdinalsFieldData>
-
getOrdinalMap
public org.apache.lucene.index.OrdinalMap getOrdinalMap()Description copied from interface:IndexOrdinalsFieldDataReturns the underlyingOrdinalMapfor this fielddata or null if global ordinals are not needed (constant value or single segment).- Specified by:
getOrdinalMapin interfaceIndexOrdinalsFieldData
-
load
Description copied from interface:IndexFieldDataLoads the atomic field data for the reader, possibly cached.- Specified by:
loadin interfaceIndexFieldData<LeafOrdinalsFieldData>
-
loadGlobal
Description copied from interface:IndexOrdinalsFieldDataLoad a global view of the ordinals for the givenIndexReader, potentially from a cache.- Specified by:
loadGlobalin interfaceIndexFieldData.Global<LeafOrdinalsFieldData>- Specified by:
loadGlobalin interfaceIndexOrdinalsFieldData
-
loadGlobalDirect
public IndexOrdinalsFieldData loadGlobalDirect(org.apache.lucene.index.DirectoryReader indexReader) throws java.lang.ExceptionDescription copied from interface:IndexOrdinalsFieldDataLoad a global view of the ordinals for the givenIndexReader.- Specified by:
loadGlobalDirectin interfaceIndexFieldData.Global<LeafOrdinalsFieldData>- Specified by:
loadGlobalDirectin interfaceIndexOrdinalsFieldData- Throws:
java.lang.Exception
-
supportsGlobalOrdinalsMapping
public boolean supportsGlobalOrdinalsMapping()Description copied from interface:IndexOrdinalsFieldDataWhether this field data is able to provide a mapping between global and segment ordinals, by returning the underlyingOrdinalMap. If this method returns false, then callingIndexOrdinalsFieldData.getOrdinalMap()will result in anUnsupportedOperationException.- Specified by:
supportsGlobalOrdinalsMappingin interfaceIndexOrdinalsFieldData
-