The `ignore_malformed` option is supported by a few of our field types, mainly numerics and dates, to still accept the document when such fields hold malformed values. See https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore-malformed.html. Also `ignore_malformed` is an index level setting that gets applied to all field types that support it. 

The boolean field type does not support `ignore_malformed` but it should, so that if a boolean field cannot be parsed as a boolean, the document can still be accepted.


server/src/main/java/org/elasticsearch/index/mapper/DynamicFieldsBuilder.java
DateFormatter dateFormatter,
        CheckedRunnable<IOException> createDynamicField
    ) throws IOException {
        createDynamicField(context, name, DynamicTemplate.XContentFieldType.DATE, dateFormatter, createDynamicField);
    }
    private static void createDynamicField(
        DocumentParserContext context,
        String name,
        DynamicTemplate.XContentFieldType matchType,
        CheckedRunnable<IOException> dynamicFieldStrategy
    ) throws IOException {
        assert matchType != DynamicTemplate.XContentFieldType.DATE;
        createDynamicField(context, name, matchType, null, dynamicFieldStrategy);
    }
    private static void createDynamicField(
        DocumentParserContext context,
        String name,
        DynamicTemplate.XContentFieldType matchType,
        DateFormatter dateFormatter,
        CheckedRunnable<IOException> dynamicFieldStrategy
    ) throws IOException {
        if (applyMatchingTemplate(context, name, matchType, dateFormatter) == false) {
            dynamicFieldStrategy.run();
        }
    }
    /**
     * Find and apply a matching dynamic template. Returns {@code true} if a template could be found, {@code false} otherwise.
     * @param context        the parse context for this document
     * @param name           the current field name
     * @param matchType      the type of the field in the json document or null if unknown