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/test/java/org/elasticsearch/index/mapper/BooleanScriptFieldTypeTests.java
@SuppressWarnings("unchecked")
                public void execute() {
                    Map<String, Object> source = (Map<String, Object>) this.getParams().get("_source");
                    for (Object foo : (List<?>) source.get("foo")) {
                        emit((Boolean) foo ^ ((Boolean) getParams().get("param")));
                    }
                }
            };
            case "loop" -> (fieldName, params, lookup, onScriptError) -> {
                
                lookup.forkAndTrackFieldReferences("test");
                throw new IllegalStateException("should have thrown on the line above");
            };
            case "error" -> (fieldName, params, lookup, onScriptError) -> ctx -> new BooleanFieldScript(
                fieldName,
                params,
                lookup,
                onScriptError,
                ctx
            ) {
                @Override
                public void execute() {
                    throw new RuntimeException("test error");
                }
            };
            default -> throw new IllegalArgumentException("unsupported script [" + script.getIdOrCode() + "]");
        };
    }
}