# Can't post data

**URL:** <https://discuss.elastic.co/t/cant-post-data/123003>\
**Category:** Elasticsearch\
**Created:** [March 8, 2018, 4:45am UTC](https://discuss.elastic.co/t/cant-post-data/123003 "2018-03-08T04:45:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiratsu](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@shiratsu](https://discuss.elastic.co/u/shiratsu)\
**Post date:** [March 8, 2018, 4:45am UTC](https://discuss.elastic.co/t/cant-post-data/123003/1 "2018-03-08T04:45:49Z")

</div>

Hi there.  
I have started to use elasticesearch nowadays.  
then,  
at first i would like to post data by curl command by following this page.  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html)  
But i can't.  
my index is here.

```auto
$ curl -H "Content-Type: application/json" -XGET 'http://localhost:9200/shakespeare?pretty'
{
  "shakespeare" : {
    "aliases" : { },
    "mappings" : {
      "shakespeare" : {
        "properties" : {
          "line_id" : {
            "type" : "integer"
          },
          "play_name" : {
            "type" : "text"
          },
          "speaker" : {
            "type" : "text"
          },
          "speech_number" : {
            "type" : "integer"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "creation_date" : "1520341215833",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "rsu73dnpTPWCro8gBoKdtA",
        "version" : {
          "created" : "6020299"
        },
        "provided_name" : "shakespeare"
      }
    }
  }
}

```

error message is here.

```auto
$ curl -XPOST 'localhost:9200/_bulk?pretty' -H 'Content-Type: application/json' -d'
quote> { "index" : { "_index" : "shakespeare", "_type" : "_doc", "_id" : "1" } }
quote> {"line_id":1,"play_name":"Henry IV","speech_number":0,"speaker":"hiratsuka"}
quote> { "index" : { "_index" : "shakespeare", "_type" : "_doc", "_id" : "2" } }
quote> {"line_id":1,"play_name":"test IV","speech_number":0,"speaker":"test"}
quote> '
{
  "took" : 204,
  "errors" : true,
  "items" : [
    {
      "index" : {
        "_index" : "shakespeare",
        "_type" : "_doc",
        "_id" : "1",
        "status" : 400,
        "error" : {
          "type" : "illegal_argument_exception",
          "reason" : "Rejecting mapping update to [shakespeare] as the final mapping would have more than 1 type: [_doc, shakespeare]"
        }
      }
    },
    {
      "index" : {
        "_index" : "shakespeare",
        "_type" : "_doc",
        "_id" : "2",
        "status" : 400,
        "error" : {
          "type" : "illegal_argument_exception",
          "reason" : "Rejecting mapping update to [shakespeare] as the final mapping would have more than 1 type: [_doc, shakespeare]"
        }
      }
    }
  ]
}

```

What is this problem?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 8, 2018, 4:48am UTC](https://discuss.elastic.co/t/cant-post-data/123003/2 "2018-03-08T04:48:16Z")

</div>

> [@shiratsu](#):
>
> "mappings" : {  
> "shakespeare" : {

You need to delete the index/mapping change that `shakespeare` to `_doc` and you should be ok.

---

<div class="post-metadata">

**Author:** ![shiratsu](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@shiratsu](https://discuss.elastic.co/u/shiratsu)\
**Post date:** [March 8, 2018, 10:16pm UTC](https://discuss.elastic.co/t/cant-post-data/123003/3 "2018-03-08T22:16:17Z")

</div>

You said that i should re-create index from begining,right?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [March 8, 2018, 10:20pm UTC](https://discuss.elastic.co/t/cant-post-data/123003/4 "2018-03-08T22:20:27Z")

</div>

Correct.

---

<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:** [April 5, 2018, 10:20pm UTC](https://discuss.elastic.co/t/cant-post-data/123003/5 "2018-04-05T22:20:41Z")

</div>

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