# Index creation on bulk update

**URL:** <https://discuss.elastic.co/t/index-creation-on-bulk-update/227344>\
**Category:** Elasticsearch\
**Created:** [April 9, 2020, 2:25pm UTC](https://discuss.elastic.co/t/index-creation-on-bulk-update/227344 "2020-04-09T14:25:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![111313](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111313/32/45904_2.png) [@111313](https://discuss.elastic.co/u/111313)\
**Post date:** [April 9, 2020, 2:25pm UTC](https://discuss.elastic.co/t/index-creation-on-bulk-update/227344/1 "2020-04-09T14:25:30Z")

</div>

Hello.  
I noticed for operation bulk update, for example  
`POST http://localhost:9200/_bulk`

```
{"update":{"_id":"1", "_index" : "index", "_type": "type"}}

```

```auto
{"doc": {"id": "1", "name": "test"}}

```

if index with name "index" doesn't exist I will recieve response

```
   {
        "took": 115,
        "errors": true,
        "items": [
            {
                "update": {
                "_index": "index",
                "_type": "type",
                "_id": "1",
                "status": 404,
                "error": {
                    "type": "document_missing_exception",
                    "reason": "[type][1]: document missing",
                    "index_uuid": "e7URDCeDRJGCclNISsFr2Q",
                    "shard": "3",
                    "index": "index"
                    }
                }
            }
        ]
    }

```

and index with name "index" will be created. As I see error absolutely correct, because I don't have any docs, but creating new index is strange for me. I waited for error like "No such index"  
Can someone, please, explain such behavior. Is it correct that new index was created? And how can I avoid it without extra check for index existance?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 9, 2020, 2:38pm UTC](https://discuss.elastic.co/t/index-creation-on-bulk-update/227344/2 "2020-04-09T14:38:21Z")

</div>

That sounds "correct" to me.  
I mean that the way elasticsearch works will first create any missing index before executing any request on that index.  
I'm not surprised and I'm not sure if this should be considered as a bug.

---

<div class="post-metadata">

**Author:** ![111313](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111313/32/45904_2.png) [@111313](https://discuss.elastic.co/u/111313)\
**Post date:** [April 9, 2020, 2:47pm UTC](https://discuss.elastic.co/t/index-creation-on-bulk-update/227344/3 "2020-04-09T14:47:19Z")

</div>

Thank you for your time. I will remeber it. It would be good to take note about it in documentation.

---

<div class="post-metadata">

**Author:** ![111313](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111313/32/45904_2.png) [@111313](https://discuss.elastic.co/u/111313)\
**Post date:** [April 9, 2020, 4:15pm UTC](https://discuss.elastic.co/t/index-creation-on-bulk-update/227344/4 "2020-04-09T16:15:49Z")

</div>

As a solution that affects the whole system, adding action.auto\_create\_index: false in elasticsearch.yml will solve this task.

---

<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:** [May 7, 2020, 4:15pm UTC](https://discuss.elastic.co/t/index-creation-on-bulk-update/227344/5 "2020-05-07T16:15:53Z")

</div>

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