# How to fix Validation Failed: 1: mapping type is missing

**URL:** <https://discuss.elastic.co/t/how-to-fix-validation-failed-1-mapping-type-is-missing/183367>\
**Category:** Elasticsearch\
**Created:** [May 29, 2019, 3:05pm UTC](https://discuss.elastic.co/t/how-to-fix-validation-failed-1-mapping-type-is-missing/183367 "2019-05-29T15:05:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aymen\_Ben\_Moussa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aymen_ben_moussa/32/44513_2.png) [@Aymen\_Ben\_Moussa](https://discuss.elastic.co/u/Aymen_Ben_Moussa)\
**Post date:** [May 29, 2019, 3:05pm UTC](https://discuss.elastic.co/t/how-to-fix-validation-failed-1-mapping-type-is-missing/183367/1 "2019-05-29T15:05:01Z")

</div>

this is my index default mapping

```
> {
> "yoyo4y" : {
> "mappings" : {
> "doc" : {
> "properties" : {
> "@timestamp" : {
> "type" : "date"
> },
> "@version" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "after" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "op" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "patch" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "source" : {
> "properties" : {
> "connector" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "h" : {
> "type" : "long"
> },
> "initsync" : {
> "type" : "boolean"
> },
> "name" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "ns" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "ord" : {
> "type" : "long"
> },
> "rs" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "sec" : {
> "type" : "long"
> },
> "version" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> }
> }
> },
> "ts_ms" : {
> "type" : "long"
> }
> }
> }
> }
> }
> }

```

and this is a mapping based on the first one, i want to define to a empty index

```
> PUT firstindex/_mapping/
> {
> "mappings" : {
>      
> "doc" : {
>        
> "properties" : {
> "@timestamp" : {
> "type" : "date"
> },
> "@version" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "after": {
>             
> "properties": {
> "_id": {
> "properties": {
> "$oid" : { "type": "text" }, 
> "name" : { "type": "text" },
> "number": { "type": "int" }, 
> "season": { "type": "text" }
> },
> "op" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "patch" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "source" : {
> "properties" : {
> "connector" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "h" : {
> "type" : "long"
> },
> "initsync" : {
> "type" : "boolean"
> },
> "name" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "ns" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "ord" : {
> "type" : "long"
> },
> "rs" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> },
> "sec" : {
> "type" : "long"
> },
> "version" : {
> "type" : "text",
> "fields" : {
> "keyword" : {
> "type" : "keyword",
> "ignore_above" : 256
> }
> }
> }
> }
> },
> "ts_ms" : {
> "type" : "long"
> }
> }
> }
> }
> }
> }
> }
> }}}
```

---

<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:** [June 26, 2019, 3:05pm UTC](https://discuss.elastic.co/t/how-to-fix-validation-failed-1-mapping-type-is-missing/183367/2 "2019-06-26T15:05:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
