# Newbie question on adding data

**URL:** <https://discuss.elastic.co/t/newbie-question-on-adding-data/192743>\
**Category:** Elasticsearch\
**Created:** [July 29, 2019, 4:25pm UTC](https://discuss.elastic.co/t/newbie-question-on-adding-data/192743 "2019-07-29T16:25:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticHT](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@elasticHT](https://discuss.elastic.co/u/elasticHT)\
**Post date:** [July 29, 2019, 4:25pm UTC](https://discuss.elastic.co/t/newbie-question-on-adding-data/192743/1 "2019-07-29T16:25:58Z")

</div>

I am getting an error trying to add values to an index I created. My index is just a listing of companies, what type of texting they offer (SMS, MMS, etc.), the URL, and the date created.

Here's the index I created:

```
MAPPING
--------

```

PUT textingcompanyinfo  
{  
"mappings": {  
"properties": {  
"company":  
{ "type": "text" },  
"type\_of\_service": { "type": "text" },  
"url": { "type": "text" },  
"created": {  
"type": "date",  
"format": "yyyy-MM-dd||epoch\_millis"  
}  
}  
}  
}

And, here's an example PUT

PUT [http://localhost:9200/textingcompanyinfo/1](http://localhost:9200/textingcompanyinfo/1)  
{  
"company": "AT&T",  
"type\_of\_service": "SMS",  
"url": "number@txt.att.net" ,  
"created":"2019-07-29"  
}

--

But, I'm getting this error:

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

```

--

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![John\_Guzman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_guzman/32/83587_2.png) [@John\_Guzman](https://discuss.elastic.co/u/John_Guzman)\
**Post date:** [July 29, 2019, 5:27pm UTC](https://discuss.elastic.co/t/newbie-question-on-adding-data/192743/2 "2019-07-29T17:27:23Z")

</div>

Hello!

Elasticsearch 7.0+ only permits to have one type for index and by default is \_doc.

Now, in your put you are Specifying the type as "1". If what you want is to define the id of the doccument when indexing, you should do something like this:

`PUT http://localhost:9200/textingcompanyinfo/_doc/1`

---

<div class="post-metadata">

**Author:** ![elasticHT](https://avatars.discourse-cdn.com/v4/letter/e/9de0a6/32.png) [@elasticHT](https://discuss.elastic.co/u/elasticHT)\
**Post date:** [July 29, 2019, 5:52pm UTC](https://discuss.elastic.co/t/newbie-question-on-adding-data/192743/3 "2019-07-29T17:52:50Z")

</div>

Thank you!

---

<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:** [August 26, 2019, 5:53pm UTC](https://discuss.elastic.co/t/newbie-question-on-adding-data/192743/4 "2019-08-26T17:53:01Z")

</div>

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