Class FlattenedFieldMapper.KeyedFlattenedFieldData
java.lang.Object
org.elasticsearch.index.mapper.flattened.FlattenedFieldMapper.KeyedFlattenedFieldData
- All Implemented Interfaces:
IndexFieldData<LeafOrdinalsFieldData>
,IndexFieldData.Global<LeafOrdinalsFieldData>
,IndexOrdinalsFieldData
- Enclosing class:
- FlattenedFieldMapper
public static class FlattenedFieldMapper.KeyedFlattenedFieldData extends java.lang.Object implements IndexOrdinalsFieldData
A field data implementation that gives access to the values associated with
a particular JSON key.
This class wraps the field data that is built directly on the keyed flattened field,
and filters out values whose prefix doesn't match the requested key. Loading and caching
is fully delegated to the wrapped field data, so that different
FlattenedFieldMapper.KeyedFlattenedFieldData
for the same flattened field share the same global ordinals.
Because of the code-level complexity it would introduce, it is currently not possible
to retrieve the underlying global ordinals map through getOrdinalMap()
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlattenedFieldMapper.KeyedFlattenedFieldData.Builder
Nested classes/interfaces inherited from interface org.elasticsearch.index.fielddata.IndexFieldData
IndexFieldData.Global<FD extends LeafFieldData>, IndexFieldData.XFieldComparatorSource
-
Method Summary
Modifier and Type Method Description java.lang.String
getFieldName()
The field name.java.lang.String
getKey()
org.apache.lucene.index.OrdinalMap
getOrdinalMap()
Returns the underlyingOrdinalMap
for this fielddata or null if global ordinals are not needed (constant value or single segment).ValuesSourceType
getValuesSourceType()
The ValuesSourceType of the underlying data.LeafOrdinalsFieldData
load(org.apache.lucene.index.LeafReaderContext context)
Loads the atomic field data for the reader, possibly cached.LeafOrdinalsFieldData
loadDirect(org.apache.lucene.index.LeafReaderContext context)
Loads directly the atomic field data for the reader, ignoring any caching involved.IndexOrdinalsFieldData
loadGlobal(org.apache.lucene.index.DirectoryReader indexReader)
Load a global view of the ordinals for the givenIndexReader
, potentially from a cache.IndexOrdinalsFieldData
loadGlobalDirect(org.apache.lucene.index.DirectoryReader indexReader)
Load a global view of the ordinals for the givenIndexReader
.BucketedSort
newBucketedSort(BigArrays bigArrays, java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra)
Build a sort implementation specialized for aggregations.org.apache.lucene.search.SortField
sortField(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)
Returns theSortField
to use for sorting.boolean
supportsGlobalOrdinalsMapping()
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, wait
-
Method Details
-
getKey
public java.lang.String getKey() -
getFieldName
public java.lang.String getFieldName()Description copied from interface:IndexFieldData
The field name.- Specified by:
getFieldName
in interfaceIndexFieldData<LeafOrdinalsFieldData>
-
getValuesSourceType
Description copied from interface:IndexFieldData
The 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:
getValuesSourceType
in interfaceIndexFieldData<LeafOrdinalsFieldData>
-
sortField
public org.apache.lucene.search.SortField sortField(java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, boolean reverse)Description copied from interface:IndexFieldData
Returns theSortField
to use for sorting.- Specified by:
sortField
in interfaceIndexFieldData<LeafOrdinalsFieldData>
-
newBucketedSort
public BucketedSort newBucketedSort(BigArrays bigArrays, java.lang.Object missingValue, MultiValueMode sortMode, IndexFieldData.XFieldComparatorSource.Nested nested, SortOrder sortOrder, DocValueFormat format, int bucketSize, BucketedSort.ExtraData extra)Description copied from interface:IndexFieldData
Build a sort implementation specialized for aggregations.- Specified by:
newBucketedSort
in interfaceIndexFieldData<LeafOrdinalsFieldData>
-
load
Description copied from interface:IndexFieldData
Loads the atomic field data for the reader, possibly cached.- Specified by:
load
in interfaceIndexFieldData<LeafOrdinalsFieldData>
-
loadDirect
public LeafOrdinalsFieldData loadDirect(org.apache.lucene.index.LeafReaderContext context) throws java.lang.ExceptionDescription copied from interface:IndexFieldData
Loads directly the atomic field data for the reader, ignoring any caching involved.- Specified by:
loadDirect
in interfaceIndexFieldData<LeafOrdinalsFieldData>
- Throws:
java.lang.Exception
-
loadGlobal
Description copied from interface:IndexOrdinalsFieldData
Load a global view of the ordinals for the givenIndexReader
, potentially from a cache.- Specified by:
loadGlobal
in interfaceIndexFieldData.Global<LeafOrdinalsFieldData>
- Specified by:
loadGlobal
in interfaceIndexOrdinalsFieldData
-
loadGlobalDirect
public IndexOrdinalsFieldData loadGlobalDirect(org.apache.lucene.index.DirectoryReader indexReader) throws java.lang.ExceptionDescription copied from interface:IndexOrdinalsFieldData
Load a global view of the ordinals for the givenIndexReader
.- Specified by:
loadGlobalDirect
in interfaceIndexFieldData.Global<LeafOrdinalsFieldData>
- Specified by:
loadGlobalDirect
in interfaceIndexOrdinalsFieldData
- Throws:
java.lang.Exception
-
getOrdinalMap
public org.apache.lucene.index.OrdinalMap getOrdinalMap()Description copied from interface:IndexOrdinalsFieldData
Returns the underlyingOrdinalMap
for this fielddata or null if global ordinals are not needed (constant value or single segment).- Specified by:
getOrdinalMap
in interfaceIndexOrdinalsFieldData
-
supportsGlobalOrdinalsMapping
public boolean supportsGlobalOrdinalsMapping()Description copied from interface:IndexOrdinalsFieldData
Whether 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:
supportsGlobalOrdinalsMapping
in interfaceIndexOrdinalsFieldData
-