Package org.opensearch.join.mapper
Class ParentJoinFieldMapper
java.lang.Object
org.opensearch.index.mapper.Mapper
org.opensearch.index.mapper.FieldMapper
org.opensearch.join.mapper.ParentJoinFieldMapper
- All Implemented Interfaces:
Cloneable,Iterable<Mapper>,ToXContent,ToXContentFragment
A
FieldMapper that creates hierarchical joins (parent-join) between documents in the same index.
Only one parent-join field can be defined per index. The verification of this assumption is done
through the MetaJoinFieldMapper which declares a meta field called "_parent_join".
This field is only used to ensure that there is a single parent-join field defined in the mapping and
cannot be used to index or query any data.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic final classstatic classNested classes/interfaces inherited from class org.opensearch.index.mapper.FieldMapper
FieldMapper.CopyTo, FieldMapper.MultiFieldsNested classes/interfaces inherited from class org.opensearch.index.mapper.Mapper
Mapper.BuilderContextNested classes/interfaces inherited from interface org.opensearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
FieldsFields inherited from class org.opensearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, fieldType, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFieldsFields inherited from interface org.opensearch.common.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedParentJoinFieldMapper(String simpleName, FieldType fieldType, MappedFieldType mappedFieldType, MetaJoinFieldMapper uniqueFieldMapper, List<ParentIdFieldMapper> parentIdFields, boolean eagerGlobalOrdinals) -
Method Summary
Modifier and TypeMethodDescriptionprotected ParentJoinFieldMapperclone()protected Stringprotected voiddoXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) static ParentJoinFieldMappergetMapper(MapperService service) Returns theParentJoinFieldMapperassociated with theserviceor null if there is no parent-join field in this mapping.getParentIdFieldMapper(String name, boolean isParent) Returns the parent Id field mapper associated with a parentnameifisParentis true and a childnameotherwise.booleanReturns true ifnameis a child name in the field.booleanReturns true ifnameis a parent name in the field.iterator()protected voidmergeOptions(FieldMapper other, List<String> conflicts) voidparse(ParseContext context) protected voidparseCreateField(ParseContext context) Methods inherited from class org.opensearch.index.mapper.FieldMapper
copyTo, createFieldNamesField, docValuesByDefault, doValidate, doXContentAnalyzers, indexedByDefault, indexOptionToString, merge, multiFields, name, parsesArrayValue, storedByDefault, toXContent, typeName, validateMethods inherited from class org.opensearch.index.mapper.Mapper
hasIndexCreated, simpleNameMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.opensearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
- See Also:
-
CONTENT_TYPE
- See Also:
-
-
Constructor Details
-
ParentJoinFieldMapper
protected ParentJoinFieldMapper(String simpleName, FieldType fieldType, MappedFieldType mappedFieldType, MetaJoinFieldMapper uniqueFieldMapper, List<ParentIdFieldMapper> parentIdFields, boolean eagerGlobalOrdinals)
-
-
Method Details
-
getMapper
Returns theParentJoinFieldMapperassociated with theserviceor null if there is no parent-join field in this mapping. -
contentType
- Specified by:
contentTypein classFieldMapper
-
clone
- Overrides:
clonein classFieldMapper
-
fieldType
- Overrides:
fieldTypein classFieldMapper
-
iterator
- Specified by:
iteratorin interfaceIterable<Mapper>- Overrides:
iteratorin classFieldMapper
-
hasParent
Returns true ifnameis a parent name in the field. -
hasChild
Returns true ifnameis a child name in the field. -
getParentIdFieldMapper
Returns the parent Id field mapper associated with a parentnameifisParentis true and a childnameotherwise. -
mergeOptions
- Specified by:
mergeOptionsin classFieldMapper
-
parseCreateField
- Specified by:
parseCreateFieldin classFieldMapper- Throws:
IOException
-
parse
- Overrides:
parsein classFieldMapper- Throws:
IOException
-
doXContentBody
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws IOException - Overrides:
doXContentBodyin classFieldMapper- Throws:
IOException
-