Package org.elasticsearch.join.mapper
Class ParentJoinFieldMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.join.mapper.ParentJoinFieldMapper
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<Mapper>,ToXContent,ToXContentFragment
public final class ParentJoinFieldMapper extends FieldMapper
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 Classes Modifier and Type Class Description static classParentJoinFieldMapper.Builderstatic classParentJoinFieldMapper.Defaultsstatic classParentJoinFieldMapper.JoinFieldTypestatic classParentJoinFieldMapper.TypeParserNested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.CopyTo, FieldMapper.MultiFieldsNested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContextNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTENT_TYPEstatic java.lang.StringNAMEFields inherited from class org.elasticsearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, fieldType, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFields -
Constructor Summary
Constructors Modifier Constructor Description protectedParentJoinFieldMapper(java.lang.String simpleName, FieldType fieldType, MappedFieldType mappedFieldType, MetaJoinFieldMapper uniqueFieldMapper, java.util.List<ParentIdFieldMapper> parentIdFields, boolean eagerGlobalOrdinals) -
Method Summary
Modifier and Type Method Description protected ParentJoinFieldMapperclone()protected java.lang.StringcontentType()protected voiddoXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params)ParentJoinFieldMapper.JoinFieldTypefieldType()static ParentJoinFieldMappergetMapper(MapperService service)Returns theParentJoinFieldMapperassociated with theserviceor null if there is no parent-join field in this mapping.ParentIdFieldMappergetParentIdFieldMapper(java.lang.String name, boolean isParent)Returns the parent Id field mapper associated with a parentnameifisParentis true and a childnameotherwise.booleanhasChild(java.lang.String name)Returns true ifnameis a child name in the field.booleanhasParent(java.lang.String name)Returns true ifnameis a parent name in the field.java.util.Iterator<Mapper>iterator()protected voidmergeOptions(FieldMapper other, java.util.List<java.lang.String> conflicts)voidparse(ParseContext context)protected voidparseCreateField(ParseContext context)Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
copyTo, createFieldNamesField, docValuesByDefault, doXContentAnalyzers, indexedByDefault, indexOptionToString, merge, name, parsesArrayValue, storedByDefault, termVectorOptionsToString, toXContent, typeName
-
Field Details
-
NAME
public static final java.lang.String NAME- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE- See Also:
- Constant Field Values
-
-
Constructor Details
-
ParentJoinFieldMapper
protected ParentJoinFieldMapper(java.lang.String simpleName, FieldType fieldType, MappedFieldType mappedFieldType, MetaJoinFieldMapper uniqueFieldMapper, java.util.List<ParentIdFieldMapper> parentIdFields, boolean eagerGlobalOrdinals)
-
-
Method Details
-
getMapper
Returns theParentJoinFieldMapperassociated with theserviceor null if there is no parent-join field in this mapping. -
contentType
protected java.lang.String contentType()- Specified by:
contentTypein classFieldMapper
-
clone
- Overrides:
clonein classFieldMapper
-
fieldType
- Overrides:
fieldTypein classFieldMapper
-
iterator
- Specified by:
iteratorin interfacejava.lang.Iterable<Mapper>- Overrides:
iteratorin classFieldMapper
-
hasParent
public boolean hasParent(java.lang.String name)Returns true ifnameis a parent name in the field. -
hasChild
public boolean hasChild(java.lang.String name)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:
java.io.IOException
-
parse
- Overrides:
parsein classFieldMapper- Throws:
java.io.IOException
-
doXContentBody
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws java.io.IOException- Overrides:
doXContentBodyin classFieldMapper- Throws:
java.io.IOException
-