if ((esType != null && esType.equals(FieldType.NESTED)) || isArrayField(fieldMapping)) {
private static Field skipHeaders(Field field) { Field[] props = field.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties return props[0].properties()[0]; } return field; }
private static Field skipHeaders(Field field) { Field[] props = field.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties return props[0].properties()[0]; } return field; }
private static Field skipHeaders(Field field) { Field[] props = field.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties return props[0].properties()[0]; } return field; }
private static Field skipHeaders(Field field) { Field[] props = field.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties return props[0].properties()[0]; } return field; }
private static Mapping mergeMappings(List<Field> fields) { Map<String, Object[]> fieldMap = new LinkedHashMap<String, Object[]>(); for (Field rootField : fields) { Field[] props = rootField.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties Field[] mappings = props[0].properties(); for (Field mapping : mappings) { // At this point we have the root mapping info for (Field field : mapping.properties()) { addToFieldTable(field, "", fieldMap); } } } } Field[] collapsed = collapseFields(fieldMap); return new Mapping(RESOLVED_MAPPING_NAME, collapsed); }
private static Mapping mergeMappings(List<Field> fields) { Map<String, Object[]> fieldMap = new LinkedHashMap<String, Object[]>(); for (Field rootField : fields) { Field[] props = rootField.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties Field[] mappings = props[0].properties(); for (Field mapping : mappings) { // At this point we have the root mapping info for (Field field : mapping.properties()) { addToFieldTable(field, "", fieldMap); } } } } Field[] collapsed = collapseFields(fieldMap); return new Mapping(RESOLVED_MAPPING_NAME, collapsed); }
private static Mapping mergeMappings(List<Field> fields) { Map<String, Object[]> fieldMap = new LinkedHashMap<String, Object[]>(); for (Field rootField : fields) { Field[] props = rootField.properties(); // handle the common case of mapping by removing the first field (mapping.) if (props.length > 0 && props[0] != null && "mappings".equals(props[0].name()) && FieldType.OBJECT.equals(props[0].type())) { // can't return the type as it is an object of properties Field[] mappings = props[0].properties(); for (Field mapping : mappings) { // At this point we have the root mapping info for (Field field : mapping.properties()) { addToFieldTable(field, "", fieldMap); } } } } Field[] collapsed = collapseFields(fieldMap); return new Mapping(RESOLVED_MAPPING_NAME, collapsed); }
if ((esType != null && esType.equals(FieldType.NESTED)) || isArrayField(fieldMapping)) {
if ((esType != null && esType.equals(FieldType.NESTED)) || isArrayField(fieldMapping)) {
if ((esType != null && esType.equals(FieldType.NESTED)) || isArrayField(fieldMapping)) {