@Override public ParentFieldMapper build(BuilderContext context) { if (parentType == null) { throw new MapperParsingException("[_parent] field mapping must contain the [type] option"); } parentJoinFieldType.setName(joinField(documentType)); parentJoinFieldType.setFieldDataType(null); childJoinFieldType.setName(joinField(parentType)); return new ParentFieldMapper( fieldType, parentJoinFieldType, childJoinFieldType, parentType, context.indexSettings()); }
@Override public Builder fieldDataSettings(Settings fieldDataSettings) { Settings settings = Settings.builder() .put(childJoinFieldType.fieldDataType().getSettings()) .put(fieldDataSettings) .build(); childJoinFieldType.setFieldDataType( new FieldDataType(childJoinFieldType.fieldDataType().getType(), settings)); return this; }