title: ES Index with python - combine normal Mapping Setting incl. index.mapping.ignore_malformed
body: <p>I need help while trying to add ignore_malformed to my index settings.</p>
  <p>I have:</p>
  <pre><code>from elasticsearch import Elasticsearch
  es = Elasticsearch(
    [{'host': 'localhost', 'port': 9200}])
  
  index_name = 'product'
  
  settings = {
  &quot;settings&quot;: {
      &quot;index.refresh_interval&quot; : &quot;1s&quot;,
      &quot;index.mapping.total_fields.limit&quot;: 10000,
      &quot;number_of_shards&quot;: 1,
      &quot;number_of_replicas&quot;: 0
    },
  &quot;mappings&quot;: {
    &quot;properties&quot;: {
          &quot;location&quot;: {
            &quot;type&quot;: &quot;geo_point&quot;
          }
        },
      &quot;dynamic_templates&quot;: [
        {
          &quot;strings_as_keywords&quot;: {
            &quot;match_mapping_type&quot;: &quot;string&quot;,
            &quot;mapping&quot;: {
              &quot;type&quot;: &quot;text&quot;,
              &quot;fields&quot;: {
                &quot;keyword&quot;: {
                  &quot;type&quot;: &quot;keyword&quot;,
                  &quot;ignore_above&quot;: 256
                }
              }
            }
          }
        }
      ]
    }
  }
  
  es.indices.create(index=index_name, body=settings)
  </code></pre>
  <p>If I try to add &quot;index.mapping.ignore_malformed&quot;: true,
  I get:
  <strong>NameError: name 'true' is not defined</strong></p>
  <p>With following I can perform this setting but I need both at once while indexing:</p>
  <pre><code>from elasticsearch import Elasticsearch
  # conntect es
  es = Elasticsearch(
    [{'host': 'localhost', 'port': 9200}])
  from elasticsearch_dsl import Index
  index_name = 'product'
  index = Index(index_name, es)
  index.settings(
          index={'mapping':{'ignore_malformed':True}}
      )
  index.create()
  </code></pre>
  <p>Under Edit Settings in Kibana my current index specs are:</p>
  <pre><code>{
    &quot;index.blocks.read_only_allow_delete&quot;: &quot;false&quot;,
    &quot;index.priority&quot;: &quot;1&quot;,
    &quot;index.query.default_field&quot;: [
      &quot;*&quot;
    ],
    &quot;index.write.wait_for_active_shards&quot;: &quot;1&quot;,
    &quot;index.mapping.total_fields.limit&quot;: &quot;10000&quot;,
    &quot;index.refresh_interval&quot;: &quot;1s&quot;,
    &quot;index.number_of_replicas&quot;: &quot;0&quot;
  }
  </code></pre>
  <p>How can I combine above mentioned while creating my index to get:</p>
  <pre><code>{
    &quot;index.blocks.read_only_allow_delete&quot;: &quot;false&quot;,
    &quot;index.priority&quot;: &quot;1&quot;,
    &quot;index.query.default_field&quot;: [
      &quot;*&quot;
    ],
    &quot;index.write.wait_for_active_shards&quot;: &quot;1&quot;,
    &quot;index.mapping.total_fields.limit&quot;: &quot;10000&quot;,
    &quot;index.refresh_interval&quot;: &quot;1s&quot;,
    &quot;index.mapping.ignore_malformed&quot;: &quot;true&quot;,
    &quot;index.number_of_replicas&quot;: &quot;0&quot;
  }
  </code></pre>
  <p>Beside:
  It is also not possible to add this string by editing in Kibana
  Result = Bad Request (wtf why!?)</p>
  <p>Reference:
  <a href="https://stackoverflow.com/questions/15924632/empty-string-in-elasticsearch-date-field">Empty string in Elasticsearch date field?</a></p>
  <p><a href="https://stackoverflow.com/questions/43498506/how-set-ignore-malformed-in-index-level-when-creating-an-index-through-elasticse">How set ignore_malformed in index level when creating an index through ElasticSearch DSL python wrapper?</a></p>
  <p>Thanks for any help
  Regards</p>