<p dir="auto">Suppose we create an index with the following dynamic mapping in order to indicate that any element starting with 'nested_' should be typed as nested:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;test&quot;: {
    &quot;dynamic_templates&quot;:[
      {
        &quot;nested_field&quot;: {
          &quot;mapping&quot;:{
            &quot;type&quot;:&quot;nested&quot;
          },
          &quot;match&quot;:&quot;nested_*&quot;
        }
      }
    ]  
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"test"</span>: {
    <span class="pl-ent">"dynamic_templates"</span>:[
      {
        <span class="pl-ent">"nested_field"</span>: {
          <span class="pl-ent">"mapping"</span>:{
            <span class="pl-ent">"type"</span>:<span class="pl-s"><span class="pl-pds">"</span>nested<span class="pl-pds">"</span></span>
          },
          <span class="pl-ent">"match"</span>:<span class="pl-s"><span class="pl-pds">"</span>nested_*<span class="pl-pds">"</span></span>
        }
      }
    ]  
  }
}</pre></div>
<p dir="auto">If you want to perform a nested query when there is no data in the index yet, we'll get an exception. For example:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;query&quot;: {
    &quot;nested&quot;: {
      &quot;path&quot;: &quot;nested_field&quot;,
      &quot;query&quot;: {
        &quot;match&quot;: {&quot;nested_field.a&quot;: &quot;foo&quot;} 
      } 
    }
  }
}"><pre class="notranslate">{
  <span class="pl-ent">"query"</span>: {
    <span class="pl-ent">"nested"</span>: {
      <span class="pl-ent">"path"</span>: <span class="pl-s"><span class="pl-pds">"</span>nested_field<span class="pl-pds">"</span></span>,
      <span class="pl-ent">"query"</span>: {
        <span class="pl-ent">"match"</span>: {<span class="pl-ent">"nested_field.a"</span>: <span class="pl-s"><span class="pl-pds">"</span>foo<span class="pl-pds">"</span></span>} 
      } 
    }
  }
}</pre></div>
<p dir="auto">would give us a "failed to find nested object under path" exception.</p>
<p dir="auto">We can avoid this error by declaring the mapping of the nested fields in a static way (instead of dynamic), but then you loose the power of these dynamic templates.</p>
<p dir="auto">So my question is: would it be possible to silently ignore these "failed to find nested object under path" exceptions so that it makes sense to declare nested types inside the dynamic templates?</p>
<p dir="auto"><strong>Elasticsearch version</strong>:  2.3.3</p>
<p dir="auto"><strong>JVM version</strong>: 1.8.0_91</p>
<p dir="auto"><strong>OS version</strong>: Ubuntu 14.04</p>
<p dir="auto"><strong>Description of the problem including expected versus actual behavior</strong>:</p>
<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jpountz/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jpountz">@jpountz</a> I think I might have found a problem as a result of the quick fix from <a href="https://github.com/elastic/elasticsearch/issues/18740" data-hovercard-type="issue" data-hovercard-url="/elastic/elasticsearch/issues/18740/hovercard">issue #18740</a>. It doesn't give me the "Mixing up field types" error anymore but it tells me that the IPs are not valid:</p>
<p dir="auto"><strong>Provide logs (if relevant)</strong>:<br>
<code class="notranslate">source[{"@version":"1","@timestamp":"2016-06-27T21:16:52.085Z","domain_name":"2667500489.MARS.ORDERBOX-DNS.COM.","type":"A","ip_address":"162.251.82.124,162.251.82.125,162.251.82.252,162.251.82.253","domain_name_exact":"2667500489.MARS.ORDERBOX-DNS.COM.","domain_name_length":33,"ip_address_exact":"162.251.82.124,162.251.82.125,162.251.82.252,162.251.82.253","domain_name_segmented":["2667500489mars","order","box","dns"],"last_registered":"2016-05-01T10:00:00.000-0500"}]} MapperParsingException[failed to parse [ip_address]]; nested: IllegalArgumentException[failed to parse ip [162.251.82.124,162.251.82.125,162.251.82.252,162.251.82.253], not a valid ip address]; at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:329) at org.elasticsearch.index.mapper.DocumentParser.parseObjectOrField(DocumentParser.java:309) at org.elasticsearch.index.mapper.DocumentParser.parseValue(DocumentParser.java:436) at org.elasticsearch.index.mapper.DocumentParser.parseObject(DocumentParser.java:262) at org.elasticsearch.index.mapper.DocumentParser.parseDocument(DocumentParser.java:122) at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:309) at org.elasticsearch.index.shard.IndexShard.prepareIndex(IndexShard.java:580) at org.elasticsearch.index.shard.IndexShard.prepareIndexOnPrimary(IndexShard.java:559) at org.elasticsearch.action.index.TransportIndexAction.prepareIndexOperationOnPrimary(TransportIndexAction.java:212) at org.elasticsearch.action.index.TransportIndexAction.executeIndexRequestOnPrimary(TransportIndexAction.java:224) at org.elasticsearch.action.bulk.TransportShardBulkAction.shardIndexOperation(TransportShardBulkAction.java:326) at org.elasticsearch.action.bulk.TransportShardBulkAction.shardUpdateOperation(TransportShardBulkAction.java:389) at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:191) at org.elasticsearch.action.bulk.TransportShardBulkAction.shardOperationOnPrimary(TransportShardBulkAction.java:68) at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryPhase.doRun(TransportReplicationAction.java:639) at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:279) at org.elasticsearch.action.support.replication.TransportReplicationAction$PrimaryOperationTransportHandler.messageReceived(TransportReplicationAction.java:271) at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:75) at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:376) at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.IllegalArgumentException: failed to parse ip [162.251.82.124,162.251.82.125,162.251.82.252,162.251.82.253], not a valid ip address at org.elasticsearch.index.mapper.ip.IpFieldMapper.ipToLong(IpFieldMapper.java:84) at org.elasticsearch.index.mapper.ip.IpFieldMapper.innerParseCreateField(IpFieldMapper.java:351) at org.elasticsearch.index.mapper.core.NumberFieldMapper.parseCreateField(NumberFieldMapper.java:241) at org.elasticsearch.index.mapper.FieldMapper.parse(FieldMapper.java:321) ... 23 more </code><br>
Here's the mapping:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
    &quot;settings&quot;: {
        &quot;number_of_shards&quot;: {{ num_shards }},
        &quot;number_of_replicas&quot;: 2,
        &quot;index&quot;:{
            &quot;analysis&quot;:{
               &quot;analyzer&quot;:{
                  &quot;keylower&quot;:{
                     &quot;tokenizer&quot;:&quot;keyword&quot;,
                     &quot;filter&quot;:&quot;lowercase&quot;
                  }
               }
            }
        }
    },
    &quot;mappings&quot;: {
        &quot;_default_&quot;: {
            &quot;properties&quot;: {
                &quot;ip_address&quot;:{
                    &quot;type&quot;:&quot;ip&quot;
                }
            }
        },
        &quot;NS&quot;: {
            &quot;properties&quot;: {
                &quot;domain_name&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;analyzed&quot;,
                    &quot;analyzer&quot;:&quot;keylower&quot;
                },
                &quot;domain_name_exact&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;:&quot;not_analyzed&quot;
                },
                &quot;domain_name_length&quot;: {
                    &quot;type&quot;: &quot;integer&quot;
                },
                &quot;type&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;not_analyzed&quot;
                },
                &quot;is_registered&quot;: {
                    &quot;type&quot;: &quot;boolean&quot;
                },
                &quot;last_registered&quot;: {
                    &quot;type&quot;:   &quot;date&quot;
                },
                &quot;last_deregistered&quot;: {
                    &quot;type&quot;:   &quot;date&quot;
                },
                &quot;registered_history&quot;: {
                    &quot;type&quot;:   &quot;date&quot;
                },
                &quot;deregistered_history&quot;: {
                    &quot;type&quot;:   &quot;date&quot;
                },
                &quot;name_servers&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;analyzed&quot;
                },
                &quot;name_servers_exact&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;:&quot;not_analyzed&quot;
                },
                &quot;past_name_servers&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;analyzed&quot;
                },
                &quot;past_name_servers_exact&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;:&quot;not_analyzed&quot;
                },
                &quot;domain_name_segmented&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;not_analyzed&quot;
                },
                &quot;domain_name_exact_pronounceability&quot;: {
                    &quot;type&quot;: &quot;integer&quot;
                },
                &quot;domain_name_segmented_pronounceability&quot;: {
                    &quot;type&quot;: &quot;integer&quot;
                }
            }
        },
        &quot;A&quot;: {
            &quot;properties&quot;: {
                &quot;domain_name&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;analyzed&quot;,
                    &quot;analyzer&quot;:&quot;keylower&quot;
                },
                &quot;domain_name_exact&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;:&quot;not_analyzed&quot;
                },
                &quot;domain_name_length&quot;: {
                    &quot;type&quot;: &quot;integer&quot;
                },
                &quot;type&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;not_analyzed&quot;
                },
                &quot;ip_address&quot;: {
                    &quot;type&quot;: &quot;ip&quot;
                },
                &quot;ip_address_exact&quot;: {
                    &quot;type&quot;: &quot;string&quot;,
                    &quot;index&quot;: &quot;not_analyzed&quot;
                }
            }
        }
    }
}"><pre class="notranslate"><code class="notranslate">{
    "settings": {
        "number_of_shards": {{ num_shards }},
        "number_of_replicas": 2,
        "index":{
            "analysis":{
               "analyzer":{
                  "keylower":{
                     "tokenizer":"keyword",
                     "filter":"lowercase"
                  }
               }
            }
        }
    },
    "mappings": {
        "_default_": {
            "properties": {
                "ip_address":{
                    "type":"ip"
                }
            }
        },
        "NS": {
            "properties": {
                "domain_name": {
                    "type": "string",
                    "index": "analyzed",
                    "analyzer":"keylower"
                },
                "domain_name_exact": {
                    "type": "string",
                    "index":"not_analyzed"
                },
                "domain_name_length": {
                    "type": "integer"
                },
                "type": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "is_registered": {
                    "type": "boolean"
                },
                "last_registered": {
                    "type":   "date"
                },
                "last_deregistered": {
                    "type":   "date"
                },
                "registered_history": {
                    "type":   "date"
                },
                "deregistered_history": {
                    "type":   "date"
                },
                "name_servers": {
                    "type": "string",
                    "index": "analyzed"
                },
                "name_servers_exact": {
                    "type": "string",
                    "index":"not_analyzed"
                },
                "past_name_servers": {
                    "type": "string",
                    "index": "analyzed"
                },
                "past_name_servers_exact": {
                    "type": "string",
                    "index":"not_analyzed"
                },
                "domain_name_segmented": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "domain_name_exact_pronounceability": {
                    "type": "integer"
                },
                "domain_name_segmented_pronounceability": {
                    "type": "integer"
                }
            }
        },
        "A": {
            "properties": {
                "domain_name": {
                    "type": "string",
                    "index": "analyzed",
                    "analyzer":"keylower"
                },
                "domain_name_exact": {
                    "type": "string",
                    "index":"not_analyzed"
                },
                "domain_name_length": {
                    "type": "integer"
                },
                "type": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "ip_address": {
                    "type": "ip"
                },
                "ip_address_exact": {
                    "type": "string",
                    "index": "not_analyzed"
                }
            }
        }
    }
}
</code></pre></div>
<p dir="auto">I'm not sure if this is unrelated but I've exhausted the docs and discussion at this point. I'm dealing with 20 shards(also 20 nodes), 2 replicas, 16GB of ram(8GB to heap), mlockall set to true, ran "sudo swapoff -a" on all the machines and still have problems with the GB not doing its job and nodes becoming unresponsive. Looking at the logs, I was getting errors like the one above before the GC warnings appeared, can they be related?</p>