@Override public FieldMapper updateFieldType(Map<String, MappedFieldType> fullNameToFieldType) { final MappedFieldType newFieldType = fullNameToFieldType.get(fieldType.name()); if (newFieldType == null) { // this field does not exist in the mappings yet // this can happen if this mapper represents a mapping update return this; } else if (fieldType.getClass() != newFieldType.getClass()) { throw new IllegalStateException("Mixing up field types: " + fieldType.getClass() + " != " + newFieldType.getClass() + " on field " + fieldType.name()); } MultiFields updatedMultiFields = multiFields.updateFieldType(fullNameToFieldType); if (fieldType == newFieldType && multiFields == updatedMultiFields) { return this; // no change } FieldMapper updated = clone(); updated.fieldType = newFieldType; updated.multiFields = updatedMultiFields; return updated; }
@Override public FieldMapper updateFieldType(Map<String, MappedFieldType> fullNameToFieldType) { final MappedFieldType newFieldType = fullNameToFieldType.get(fieldType.name()); if (newFieldType == null) { // this field does not exist in the mappings yet // this can happen if this mapper represents a mapping update return this; } else if (fieldType.getClass() != newFieldType.getClass()) { throw new IllegalStateException("Mixing up field types: " + fieldType.getClass() + " != " + newFieldType.getClass() + " on field " + fieldType.name()); } MultiFields updatedMultiFields = multiFields.updateFieldType(fullNameToFieldType); if (fieldType == newFieldType && multiFields == updatedMultiFields) { return this; // no change } FieldMapper updated = clone(); updated.fieldType = newFieldType; updated.multiFields = updatedMultiFields; return updated; }
@Override public FieldMapper updateFieldType(Map<String, MappedFieldType> fullNameToFieldType) { final MappedFieldType newFieldType = fullNameToFieldType.get(fieldType.name()); if (newFieldType == null) { // this field does not exist in the mappings yet // this can happen if this mapper represents a mapping update return this; } else if (fieldType.getClass() != newFieldType.getClass()) { throw new IllegalStateException("Mixing up field types: " + fieldType.getClass() + " != " + newFieldType.getClass() + " on field " + fieldType.name()); } MultiFields updatedMultiFields = multiFields.updateFieldType(fullNameToFieldType); if (fieldType == newFieldType && multiFields == updatedMultiFields) { return this; // no change } FieldMapper updated = clone(); updated.fieldType = newFieldType; updated.multiFields = updatedMultiFields; return updated; }
@Override public FieldMapper updateFieldType(Map<String, MappedFieldType> fullNameToFieldType) { final MappedFieldType newFieldType = fullNameToFieldType.get(fieldType.name()); if (newFieldType == null) { // this field does not exist in the mappings yet // this can happen if this mapper represents a mapping update return this; } else if (fieldType.getClass() != newFieldType.getClass()) { throw new IllegalStateException("Mixing up field types: " + fieldType.getClass() + " != " + newFieldType.getClass() + " on field " + fieldType.name()); } MultiFields updatedMultiFields = multiFields.updateFieldType(fullNameToFieldType); if (fieldType == newFieldType && multiFields == updatedMultiFields) { return this; // no change } FieldMapper updated = clone(); updated.fieldType = newFieldType; updated.multiFields = updatedMultiFields; return updated; }
@Override public FieldMapper updateFieldType(Map<String, MappedFieldType> fullNameToFieldType) { final MappedFieldType newFieldType = fullNameToFieldType.get(fieldType.names().fullName()); if (newFieldType == null) { // this field does not exist in the mappings yet // this can happen if this mapper represents a mapping update return this; } else if (fieldType.getClass() != newFieldType.getClass()) { throw new IllegalStateException("Mixing up field types: " + fieldType.getClass() + " != " + newFieldType.getClass() + " on field " + fieldType.names().fullName()); } MultiFields updatedMultiFields = multiFields.updateFieldType(fullNameToFieldType); if (fieldType == newFieldType && multiFields == updatedMultiFields) { return this; // no change } FieldMapper updated = clone(); updated.fieldType = newFieldType; updated.multiFields = updatedMultiFields; return updated; }