title: Where do I put the mapping files for Elasticsearch?
body: <p>I am confused by the ES docs, in fact <a href="http://www.elasticsearch.org/guide/reference/mapping/conf-mappings/" rel="noreferrer">here</a> they state the the indexes must go in the mapping dir (and indexname sub dirs):</p>
  
  <blockquote>
    <p>Mappings can be defined within files called [mapping_name].json and be
    placed either under config/mappings/_default location, or under
    config/mappings/[index_name] (for mappings that should be associated
    only with a specific index).</p>
  </blockquote>
  
  <p>But then <a href="http://www.elasticsearch.org/guide/reference/api/admin-indices-templates/" rel="noreferrer">here</a> in the "config" section, it states:</p>
  
  <blockquote>
    <p>Index templates can also be placed within the config location
    (path.conf) under the templates directory (note, make sure to place
    them on all master eligible nodes). For example, a file called
    template_1.json can be placed under config/templates and it will be
    added if it matches an index.</p>
  </blockquote>
  
  <p>I put my mapping in <code>/config/mappings/myindexname/mappinfile.json</code> and it is like:</p>
  
  <pre><code>{
      "template": "maincontentindex",
      "settings": {
          "index": {
              "analysis": {
                  "analyzer": {
                      "htmlStrippingAnalyzer": {
                          "tokenizer": "standard",
                          "filter": ["standard", "lowercase"],
                          "char_filter": "html_strip"
                      }
                  }
              }
          }
      },
  
      "mappings": {
          "rendition": {
              "_timestamp": {
                  "enabled": true,
                  "store" : true
              },
              "properties": {
                  "key": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "parentPage": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "type": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "language": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "device": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "territory": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "channel": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "template": {
                      "type": "string",
                      "store": "yes",
                      "analyzer": "keyword"
                  },
                  "meta": {
                      "properties": {
                          "content": {
                              "type": "string",
                              "store": "yes"
                          }
                      }
                  }       
              }
          }
      }
  }
  </code></pre>
  
  <p>if I use the REST Api to put it in the server it works fine and if I call /maincontentindex/rendition/_mapping I just get the above structure (even with no data).</p>
  
  <p>But with the directory I just get a 404 and if I insert anything it's just the usual dynamic mapping.</p>