@Override public CompletionFieldMapper build(BuilderContext context) { setupFieldType(context); CompletionFieldType completionFieldType = (CompletionFieldType) this.fieldType; completionFieldType.setContextMappings(contextMappings); completionFieldType.setPreservePositionIncrements(preservePositionIncrements); completionFieldType.setPreserveSep(preserveSeparators); return new CompletionFieldMapper(name, this.fieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo, maxInputLength); } }
@Override public IpFieldMapper build(BuilderContext context) { setupFieldType(context); return new IpFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public DateFieldMapper build(BuilderContext context) { setupFieldType(context); return new DateFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@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 GeoShapeFieldMapper build(BuilderContext context) { setupFieldType(context); return new GeoShapeFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), coerce(context), ignoreZValue(), context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public NumberFieldMapper build(BuilderContext context) { setupFieldType(context); return new NumberFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), coerce(context), includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public RangeFieldMapper build(BuilderContext context) { setupFieldType(context); return new RangeFieldMapper(name, fieldType, defaultFieldType, coerce(context), includeInAll, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
static KeywordFieldMapper createParentJoinFieldMapper(String docType, BuilderContext context) { KeywordFieldMapper.Builder parentJoinField = new KeywordFieldMapper.Builder(joinField(docType)); parentJoinField.indexOptions(IndexOptions.NONE); parentJoinField.docValues(true); parentJoinField.fieldType().setDocValuesType(DocValuesType.SORTED); return parentJoinField.build(context); }
@Override public BinaryFieldMapper build(BuilderContext context) { setupFieldType(context); return new BinaryFieldMapper(name, fieldType, defaultFieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public BooleanFieldMapper build(BuilderContext context) { setupFieldType(context); return new BooleanFieldMapper(name, fieldType, defaultFieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public LegacyGeoShapeFieldMapper build(BuilderContext context) { setupFieldType(context); return new LegacyGeoShapeFieldMapper(name, fieldType, defaultFieldType, ignoreMalformed(context), coerce(context), orientation(), ignoreZValue(), context.indexSettings(), multiFieldsBuilder.build(this, context), copyTo); } }
@Override public GeoPointFieldMapper build(BuilderContext context) { return build(context, name, fieldType, defaultFieldType, context.indexSettings(), multiFieldsBuilder.build(this, context), ignoreMalformed(context), ignoreZValue(context), copyTo); } }
@Override public FieldNamesFieldMapper build(BuilderContext context) { setupFieldType(context); fieldType.setHasDocValues(false); FieldNamesFieldType fieldNamesFieldType = (FieldNamesFieldType)fieldType; fieldNamesFieldType.setEnabled(enabled); return new FieldNamesFieldMapper(fieldType, context.indexSettings()); } }
@Override public IndexFieldMapper build(BuilderContext context) { setupFieldType(context); return new IndexFieldMapper(fieldType, context.indexSettings()); } }
public FieldAliasMapper build(BuilderContext context) { String fullName = context.path().pathAsText(name); return new FieldAliasMapper(name, fullName, path); } }
private static void parseNullValue(ParseContext context, ObjectMapper parentMapper, String lastFieldName) throws IOException { // we can only handle null values if we have mappings for them Mapper mapper = getMapper(parentMapper, lastFieldName, splitAndValidatePath(lastFieldName)); if (mapper != null) { // TODO: passing null to an object seems bogus? parseObjectOrField(context, mapper); } else if (parentMapper.dynamic() == ObjectMapper.Dynamic.STRICT) { throw new StrictDynamicMappingException(parentMapper.fullPath(), lastFieldName); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final IndexSettings indexSettings = context.mapperService().getIndexSettings(); return new TypeFieldMapper(indexSettings, fieldType); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final IndexSettings indexSettings = context.mapperService().getIndexSettings(); return new UidFieldMapper(indexSettings, fieldType); } }
@Override public MetadataFieldMapper getDefault(MappedFieldType fieldType, ParserContext context) { final IndexSettings indexSettings = context.mapperService().getIndexSettings(); return new IdFieldMapper(indexSettings, fieldType); } }
@Override public MetadataFieldMapper.Builder<?,?> parse(String name, Map<String, Object> node, ParserContext parserContext) throws MapperParsingException { return new Builder(parserContext.mapperService().fullName(NAME)); }