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
import org.elasticsearch.Version;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.lucene.search.function.ScriptScoreQuery;
import org.elasticsearch.index.fielddata.BooleanScriptFieldData;
import org.elasticsearch.index.fielddata.ScriptDocValues;
import org.elasticsearch.index.query.SearchExecutionContext;
import org.elasticsearch.script.BooleanFieldScript;
import org.elasticsearch.script.DocReader;
import org.elasticsearch.script.ScoreScript;
import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptCompiler;
import org.elasticsearch.script.ScriptType;
import org.elasticsearch.script.field.BooleanDocValuesField;
import org.elasticsearch.search.MultiValueMode;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.xcontent.XContentParser;
import org.elasticsearch.xcontent.XContentParser.Token;
import org.elasticsearch.xcontent.XContentType;
import org.elasticsearch.xcontent.json.JsonXContent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonList;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
public class BooleanScriptFieldTypeTests extends AbstractNonTextScriptFieldTypeTestCase {
    @Override
    public void testDocValues() throws IOException {