# Mapping being ignored?

**URL:** <https://discuss.elastic.co/t/mapping-being-ignored/33286>\
**Category:** Elasticsearch\
**Created:** [October 29, 2015, 5:44pm UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286 "2015-10-29T17:44:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsps/32/5411_2.png) [@jsps](https://discuss.elastic.co/u/jsps)\
**Post date:** [October 29, 2015, 5:44pm UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286/1 "2015-10-29T17:44:43Z")

</div>

ES 2.0  
I've been trying to apply mapping to an index ( empty index ) but it doesn't seem to persist.

I've added sync.json to /config/mappings/\_default

it contains:

```
  {
  "sync" :{
    "_timestamp" : {
      "enabled" : true,
      "path" : "time",
      "ignore_missing" : true,
      "store":true
    },
    "properties": {
      "channel": {
        "type": "string",
        "store" : true
      },
      "id": {
        "type": "integer"
      },
      "level": {
        "type": "integer",
        "store" : true
      },
      "message": {
        "type": "string"
      },
      "source": {
        "type": "string"
      },
      "time": {
        "type": "date"
      },
      "userid": {
        "type": "integer",
        "store" : true
      }
    }

  }
}

```

I then add an index from sense with:

```
PUT my_index

```

when I do GET my\_index/sync/\_mapping I get `{}`

Using the PHP API I add documents to my\_index/sync

I can query them :

```
GET my_index/_search
{
  "query": {
    "match_all": {}
  }
}

```

and get results like this:

```
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": "my_index",
        "_type": "sync",
        "_id": "AVC0jcBJFw6NV60SFjbM",
        "_score": 1,
        "_source": {
          "id": "12435",
          "channel": "abc",
          "level": "200",
          "source": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
          "message": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
          "userid": "12345",
          "time": 1403283202000
        }
      }]}
      }

```

When I do `GET my_index/sync/_mapping` i get

```
{
  "my_type": {
    "mappings": {
      "sync": {
        "properties": {
          "channel": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "level": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "time": {
            "type": "long"
          },
          "userid": {
            "type": "string"
          }
        }
      }
    }
  }
}

```

So the mapping I put in \_default is 'ignored' and ES just uses its own default mappings. The same behavior happens when I PUT the mapping instead of using the config/mappings/_default/sync.json file.  
Also kibana recognised that an index of my\_index exists but cannot see any time fields in settings_\>configure\_an\_index\_pattern,

Can anyone point me in the right direction please?

---

<div class="post-metadata">

**Author:** ![erikstephens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikstephens/32/5430_2.png) [@erikstephens](https://discuss.elastic.co/u/erikstephens)\
**Post date:** [October 29, 2015, 7:58pm UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286/2 "2015-10-29T19:58:27Z")

</div>

Sounds like this: [https://www.elastic.co/guide/en/elasticsearch/reference/2.0/\_mapping\_changes.html#\_mappings\_in\_config\_files\_not\_supported](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/_mapping_changes.html#_mappings_in_config_files_not_supported)

---

<div class="post-metadata">

**Author:** ![jsps](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsps/32/5411_2.png) [@jsps](https://discuss.elastic.co/u/jsps)\
**Post date:** [October 30, 2015, 11:09am UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286/3 "2015-10-30T11:09:09Z")

</div>

You're right - applied the new mapping and all is working finally. Many thanks

---

<div class="post-metadata">

**Author:** ![igorman](https://avatars.discourse-cdn.com/v4/letter/i/e79b87/32.png) [@igorman](https://discuss.elastic.co/u/igorman)\
**Post date:** [October 30, 2015, 4:49pm UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286/4 "2015-10-30T16:49:29Z")

</div>

I have a similar question. I have a template under config/templates that was picked up automatically in elasticsearch 1.7.2. Now it's ignored. On startup, I see elastic search showing templates[]. I noticed that I need to add it to my logstash.config now, so I did add the filename (template\_name =\> "template\_error\_log.json"). I assumed the directory would default to elasticsearchxxx/config/templates based on the documentation. When I ask the system what templates its aware of:  
curl -XGET localhost:9200/\_template  
I just gives me the default, "logstash-\*" and I can't seem to override it with the one I was using before.  
I do want continue to be able to define it in a file, not through an API.  
Any suggestions?

Thanks.

---

<div class="post-metadata">

**Author:** ![erikstephens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erikstephens/32/5430_2.png) [@erikstephens](https://discuss.elastic.co/u/erikstephens)\
**Post date:** [October 30, 2015, 5:00pm UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286/5 "2015-10-30T17:00:21Z")

</div>

I think the option is `template` not `template_name`. Might want to try using a full path to simplify your debugging.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 11:41pm UTC](https://discuss.elastic.co/t/mapping-being-ignored/33286/6 "2017-07-05T23:41:37Z")

</div>


