@Override public ParentFieldMapper build(BuilderContext context) { if (context.indexCreatedVersion().onOrAfter(Version.V_6_5_0)) { throw new MapperParsingException("[_parent] field is disabled on indices with a single type. " + "Use a [join] field instead."); } if (parentType == null) { throw new MapperParsingException("[_parent] field mapping must contain the [type] option"); } name = joinField(parentType); setupFieldType(context); return new ParentFieldMapper(createParentJoinFieldMapper(documentType, context), fieldType, parentType, context.indexSettings()); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final Settings indexSettings = context.mapperService().getIndexSettings().getSettings(); final String typeName = context.type(); KeywordFieldMapper parentJoinField = createParentJoinFieldMapper(typeName, new BuilderContext(indexSettings, new ContentPath(0))); MappedFieldType childJoinFieldType = new ParentFieldType(Defaults.FIELD_TYPE, typeName); childJoinFieldType.setName(ParentFieldMapper.NAME); return new ParentFieldMapper(parentJoinField, childJoinFieldType, null, indexSettings); } }
@Override public ParentFieldMapper build(BuilderContext context) { if (parentType == null) { throw new MapperParsingException("[_parent] field mapping must contain the [type] option"); } name = joinField(parentType); setupFieldType(context); return new ParentFieldMapper(createParentJoinFieldMapper(documentType, context), fieldType, parentType, pkColumns, context.indexSettings()); } }
@Override public ParentFieldMapper build(BuilderContext context) { if (parentType == null) { throw new MapperParsingException("[_parent] field mapping must contain the [type] option"); } name = joinField(parentType); setupFieldType(context); return new ParentFieldMapper(createParentJoinFieldMapper(documentType, context), fieldType, parentType, context.indexSettings()); } }
@Override public ParentFieldMapper build(BuilderContext context) { if (context.indexCreatedVersion().onOrAfter(Version.V_6_5_0)) { throw new MapperParsingException("[_parent] field is disabled on indices with a single type. " + "Use a [join] field instead."); } if (parentType == null) { throw new MapperParsingException("[_parent] field mapping must contain the [type] option"); } name = joinField(parentType); setupFieldType(context); return new ParentFieldMapper(createParentJoinFieldMapper(documentType, context), fieldType, parentType, context.indexSettings()); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final Settings indexSettings = context.mapperService().getIndexSettings().getSettings(); final String typeName = context.type(); KeywordFieldMapper parentJoinField = createParentJoinFieldMapper(typeName, new BuilderContext(indexSettings, new ContentPath(0))); MappedFieldType childJoinFieldType = new ParentFieldType(Defaults.FIELD_TYPE, typeName); childJoinFieldType.setName(ParentFieldMapper.NAME); return new ParentFieldMapper(parentJoinField, childJoinFieldType, null, null, indexSettings); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final Settings indexSettings = context.mapperService().getIndexSettings().getSettings(); final String typeName = context.type(); KeywordFieldMapper parentJoinField = createParentJoinFieldMapper(typeName, new BuilderContext(indexSettings, new ContentPath(0))); MappedFieldType childJoinFieldType = new ParentFieldType(Defaults.FIELD_TYPE, typeName); childJoinFieldType.setName(ParentFieldMapper.NAME); return new ParentFieldMapper(parentJoinField, childJoinFieldType, null, indexSettings); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final Settings indexSettings = context.mapperService().getIndexSettings().getSettings(); final String typeName = context.type(); KeywordFieldMapper parentJoinField = createParentJoinFieldMapper(typeName, new BuilderContext(indexSettings, new ContentPath(0))); MappedFieldType childJoinFieldType = new ParentFieldType(Defaults.FIELD_TYPE, typeName); childJoinFieldType.setName(ParentFieldMapper.NAME); return new ParentFieldMapper(parentJoinField, childJoinFieldType, null, indexSettings); } }