@Override public Y build(BuilderContext context) { context.path().add(name); Map<String, Mapper> mappers = new HashMap<>(); for (Mapper.Builder builder : mappersBuilders) { Mapper mapper = builder.build(context); Mapper existing = mappers.get(mapper.simpleName()); if (existing != null) { mapper = existing.merge(mapper, false); } mappers.put(mapper.simpleName(), mapper); } context.path().remove(); ObjectMapper objectMapper = createMapper(name, context.path().pathAsText(name), enabled, nested, dynamic, includeInAll, mappers, context.indexSettings()); return (Y) objectMapper; }
@Override public ParentJoinFieldMapper build(BuilderContext context) { checkObjectOrNested(context.path(), name); fieldType.setName(name); final List<ParentIdFieldMapper> parentIdFields = new ArrayList<>(); parentIdFieldBuilders.stream() .map((parentBuilder) -> { if (eagerGlobalOrdinals) { parentBuilder.eagerGlobalOrdinals(true); } return parentBuilder.build(context); }) .forEach(parentIdFields::add); checkParentFields(name(), parentIdFields); MetaJoinFieldMapper unique = new MetaJoinFieldMapper.Builder().build(context); return new ParentJoinFieldMapper(name, fieldType, context.indexSettings(), unique, Collections.unmodifiableList(parentIdFields), eagerGlobalOrdinals); } }
@Override public ParentJoinFieldMapper build(BuilderContext context) { checkObjectOrNested(context.path(), name); fieldType.setName(name); final List<ParentIdFieldMapper> parentIdFields = new ArrayList<>(); parentIdFieldBuilders.stream() .map((parentBuilder) -> { if (eagerGlobalOrdinals) { parentBuilder.eagerGlobalOrdinals(true); } return parentBuilder.build(context); }) .forEach(parentIdFields::add); checkParentFields(name(), parentIdFields); MetaJoinFieldMapper unique = new MetaJoinFieldMapper.Builder().build(context); return new ParentJoinFieldMapper(name, fieldType, context.indexSettings(), unique, Collections.unmodifiableList(parentIdFields), eagerGlobalOrdinals); } }
@SuppressWarnings("unchecked") public MultiFields build(FieldMapper.Builder mainFieldBuilder, BuilderContext context) { if (mapperBuilders.isEmpty()) { return empty(); } else { context.path().add(mainFieldBuilder.name()); ImmutableOpenMap.Builder mapperBuilders = this.mapperBuilders; for (ObjectObjectCursor<String, Mapper.Builder> cursor : this.mapperBuilders) { String key = cursor.key; Mapper.Builder value = cursor.value; Mapper mapper = value.build(context); assert mapper instanceof FieldMapper; mapperBuilders.put(key, mapper); } context.path().remove(); ImmutableOpenMap.Builder<String, FieldMapper> mappers = mapperBuilders.cast(); return new MultiFields(mappers.build()); } } }
@SuppressWarnings("unchecked") public MultiFields build(FieldMapper.Builder mainFieldBuilder, BuilderContext context) { if (mapperBuilders.isEmpty()) { return empty(); } else { context.path().add(mainFieldBuilder.name()); ImmutableOpenMap.Builder mapperBuilders = this.mapperBuilders; for (ObjectObjectCursor<String, Mapper.Builder> cursor : this.mapperBuilders) { String key = cursor.key; Mapper.Builder value = cursor.value; Mapper mapper = value.build(context); assert mapper instanceof FieldMapper; mapperBuilders.put(key, mapper); } context.path().remove(); ImmutableOpenMap.Builder<String, FieldMapper> mappers = mapperBuilders.cast(); return new MultiFields(mappers.build()); } } }
@Override public Y build(BuilderContext context) { context.path().add(name); Map<String, Mapper> mappers = new HashMap<>(); for (Mapper.Builder builder : mappersBuilders) { Mapper mapper = builder.build(context); Mapper existing = mappers.get(mapper.simpleName()); if (existing != null) { mapper = existing.merge(mapper, false); } mappers.put(mapper.simpleName(), mapper); } context.path().remove(); ObjectMapper objectMapper = createMapper(name, context.path().pathAsText(name), enabled, nested, dynamic, includeInAll, mappers, context.indexSettings()); return (Y) objectMapper; }
@Override public Y build(BuilderContext context) { context.path().add(name); Map<String, Mapper> mappers = new HashMap<>(); for (Mapper.Builder builder : mappersBuilders) { Mapper mapper = builder.build(context); Mapper existing = mappers.get(mapper.simpleName()); if (existing != null) { mapper = existing.merge(mapper, false); } mappers.put(mapper.simpleName(), mapper); } context.path().remove(); ObjectMapper objectMapper = createMapper(name, context.path().pathAsText(name), cqlCollection, cqlStruct, cqlUdtName, cqlMandatory, cqlPartitionKey, cqlPrimaryKeyOrder, cqlStaticColumn, enabled, nested, dynamic, includeInAll, mappers, context.indexSettings()); return (Y) objectMapper; }
@Override public Y build(BuilderContext context) { ContentPath.Type origPathType = context.path().pathType(); context.path().pathType(pathType); context.path().add(name); Map<String, Mapper> mappers = new HashMap<>(); for (Mapper.Builder builder : mappersBuilders) { Mapper mapper = builder.build(context); mappers.put(mapper.simpleName(), mapper); } context.path().pathType(origPathType); context.path().remove(); ObjectMapper objectMapper = createMapper(name, context.path().fullPathAsText(name), enabled, nested, dynamic, pathType, mappers, context.indexSettings()); objectMapper = objectMapper.includeInAllIfNotSet(includeInAll); return (Y) objectMapper; }
@Override public Y build(BuilderContext context) { context.path().add(name); Map<String, Mapper> mappers = new HashMap<>(); for (Mapper.Builder builder : mappersBuilders) { Mapper mapper = builder.build(context); Mapper existing = mappers.get(mapper.simpleName()); if (existing != null) { mapper = existing.merge(mapper, false); } mappers.put(mapper.simpleName(), mapper); } context.path().remove(); ObjectMapper objectMapper = createMapper(name, context.path().pathAsText(name), enabled, nested, dynamic, includeInAll, mappers, context.indexSettings()); return (Y) objectMapper; }
protected String buildFullName(BuilderContext context) { return context.path().pathAsText(name); }
protected String buildFullName(BuilderContext context) { return context.path().fullPathAsText(name); }
protected String buildFullName(BuilderContext context) { return context.path().pathAsText(name); }
protected String buildFullName(BuilderContext context) { return context.path().pathAsText(name); }
protected String buildIndexName(BuilderContext context) { if (context.indexCreatedVersion().onOrAfter(Version.V_2_0_0_beta1)) { return buildFullName(context); } String actualIndexName = indexName == null ? name : indexName; return context.path().pathAsText(actualIndexName); }
public FieldAliasMapper build(BuilderContext context) { String fullName = context.path().pathAsText(name); return new FieldAliasMapper(name, fullName, path); } }
public FieldAliasMapper build(BuilderContext context) { String fullName = context.path().pathAsText(name); return new FieldAliasMapper(name, fullName, path); } }
@Override public OpenNlpMapper build(BuilderContext context) { context.path().add(name); StringFieldMapper contentMapper = contentBuilder.build(context); StringFieldMapper nameMapper = nameBuilder.build(context); StringFieldMapper dateMapper = dateBuilder.build(context); StringFieldMapper locationMapper = locationBuilder.build(context); context.path().remove(); return new OpenNlpMapper(name, openNlpService, contentMapper, nameMapper, dateMapper, locationMapper); } }
@SuppressWarnings("unchecked") public MultiFields build(FieldMapper.Builder mainFieldBuilder, BuilderContext context) { if (mapperBuilders.isEmpty()) { return empty(); } else { context.path().add(mainFieldBuilder.name()); ImmutableOpenMap.Builder mapperBuilders = this.mapperBuilders; for (ObjectObjectCursor<String, Mapper.Builder> cursor : this.mapperBuilders) { String key = cursor.key; Mapper.Builder value = cursor.value; Mapper mapper = value.build(context); assert mapper instanceof FieldMapper; mapperBuilders.put(key, mapper); } context.path().remove(); ImmutableOpenMap.Builder<String, FieldMapper> mappers = mapperBuilders.cast(); return new MultiFields(mappers.build()); } } }
protected String buildFullName(BuilderContext context) { return context.path().pathAsText(name); }
public FieldAliasMapper build(BuilderContext context) { String fullName = context.path().pathAsText(name); return new FieldAliasMapper(name, fullName, path); } }