# Mapping to dynamic type of index

**URL:** <https://discuss.elastic.co/t/mapping-to-dynamic-type-of-index/153036>\
**Category:** Elasticsearch\
**Created:** [October 18, 2018, 3:38pm UTC](https://discuss.elastic.co/t/mapping-to-dynamic-type-of-index/153036 "2018-10-18T15:38:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giovanni\_Di\_Lembo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/giovanni_di_lembo/32/45714_2.png) [@Giovanni\_Di\_Lembo](https://discuss.elastic.co/u/Giovanni_Di_Lembo)\
**Post date:** [October 18, 2018, 3:38pm UTC](https://discuss.elastic.co/t/mapping-to-dynamic-type-of-index/153036/1 "2018-10-18T15:38:57Z")

</div>

Hi all,  
I try to map to all my dynamic type a mapping like that:

```
PUT my_index
{
     "mappings" : {
     "_doc": {
       "properties":{
 	   "magnitude":{"type": "float"},
    "phase":{"type": "float"},
    "time":{"type": "float"},
     "time_ms":{"type": "float"}
    }  
  }  
 }
}

```

Now when I try to post an object like this:

```
POST my_index/10001
{
         "magnitude" : 0.22864656066894531,
         "phase" : 44.902667641471815,
         "time" : 1.53259831858E9,
	"time_ms" : 1.53259831858E9

  }

```

I got :

```
    error":{
          "root_cause":[
             {
                "type": "illegal_argument_exception",
                "reason": "Rejecting mapping update to [webwams] as the final mapping would have more 
                  than 1 type: [_doc, 10001]"
             }
         ],
          "type": "illegal_argument_exception",
          "reason": "Rejecting mapping update to [webwams] as the final mapping would have more than 
          1 type: [_doc, 10001]"
    },
    "status": 400
    }
```

---

<div class="post-metadata">

**Author:** ![ggingras](https://avatars.discourse-cdn.com/v4/letter/g/7feea3/32.png) [@ggingras](https://discuss.elastic.co/u/ggingras)\
**Post date:** [October 19, 2018, 2:24pm UTC](https://discuss.elastic.co/t/mapping-to-dynamic-type-of-index/153036/2 "2018-10-19T14:24:51Z")

</div>

Hi,

You are missing the \_doc type in your post request :

```
POST my_index/_doc/10001
{
         "magnitude" : 0.22864656066894531,
         "phase" : 44.902667641471815,
         "time" : 1.53259831858E9,
	     "time_ms" : 1.53259831858E9
} 

```

Regards,

Gaetan

---

<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:** [November 16, 2018, 2:24pm UTC](https://discuss.elastic.co/t/mapping-to-dynamic-type-of-index/153036/3 "2018-11-16T14:24:54Z")

</div>

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