# Auto index creation with bulk API

**URL:** <https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 10:08am UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971 "2017-01-18T10:08:13Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuseman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuseman/32/60609_2.png) [@kuseman](https://discuss.elastic.co/u/kuseman)\
**Post date:** [January 18, 2017, 10:08am UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/1 "2017-01-18T10:08:13Z")

</div>

Hi,

I have these settings applied (ES version 1.7.5):

**action.auto\_create\_index: false**  
**index.mapper.dynamic: false**

because I want to have full control over what indices/types are created.

But, still I get these in the logs:

**[my\_index] creating index, cause [auto(bulk api)], templates [], shards [6]/[1], mappings [mapping1]**

which is problematic because now mapping1 is auto created based on the document indexed which is what I want to avoid.

Is there any more setting I can apply to get auto creation from bulk api disabled?

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 18, 2017, 10:30am UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/2 "2017-01-18T10:30:57Z")

</div>

Hi,  
Please note that 1.7.x is now EOL and no particular code patches or bug fixes will be forthcoming. [https://www.elastic.co/support/eol](https://www.elastic.co/support/eol)

Can you share how the above, mentioned modification was implemented? Please find this (v5.1.x) reference on if this is to be implemented on a per index or all indices basis.

---

<div class="post-metadata">

**Author:** ![kuseman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuseman/32/60609_2.png) [@kuseman](https://discuss.elastic.co/u/kuseman)\
**Post date:** [January 18, 2017, 10:36am UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/3 "2017-01-18T10:36:08Z")

</div>

> Can you share how the above, mentioned modification was implemented?

I don't really understand what you're after here, but if you mean how this problem is encountered is like the following:

1. A bulk request is issued and started
2. In the middle of the bulk request, a delete index request is made
3. Next item in the bulk causes ES is auto creating the index with auto mapping \<--error

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 18, 2017, 10:51am UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/4 "2017-01-18T10:51:43Z")

</div>

> [@kuseman](#):
>
> I have these settings applied (ES version 1.7.5):

Where were these applied? In the elasticsearch.yml or other?

---

<div class="post-metadata">

**Author:** ![kuseman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuseman/32/60609_2.png) [@kuseman](https://discuss.elastic.co/u/kuseman)\
**Post date:** [January 18, 2017, 10:56am UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/5 "2017-01-18T10:56:52Z")

</div>

Yes in elasticsearch.yml , on all nodes.

---

<div class="post-metadata">

**Author:** ![JKhondhu](https://avatars.discourse-cdn.com/v4/letter/j/ed655f/32.png) [@JKhondhu](https://discuss.elastic.co/u/JKhondhu)\
**Post date:** [January 18, 2017, 1:59pm UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/6 "2017-01-18T13:59:27Z")

</div>

Using POST /indexname is a manual request, not an auto-create.

The only way to prevent indexes being created manually is to make the whole cluster read only: [https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-update-settings.html#\_metadata](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/cluster-update-settings.html#_metadata)

---

<div class="post-metadata">

**Author:** ![kuseman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuseman/32/60609_2.png) [@kuseman](https://discuss.elastic.co/u/kuseman)\
**Post date:** [January 18, 2017, 2:03pm UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/7 "2017-01-18T14:03:30Z")

</div>

I'm not issuing a POST /indexname request, i'm doing a bulk index request to an existing index and while doing it removing the index in question.

---

<div class="post-metadata">

**Author:** ![kuseman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kuseman/32/60609_2.png) [@kuseman](https://discuss.elastic.co/u/kuseman)\
**Post date:** [February 2, 2017, 12:30pm UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/8 "2017-02-02T12:30:43Z")

</div>

My solution was to simply close the index first and wait 10 seconds and then delete index. This to fail any existing bulk requests and get around problem with autocreate.

---

<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:** [March 2, 2017, 12:31pm UTC](https://discuss.elastic.co/t/auto-index-creation-with-bulk-api/71971/9 "2017-03-02T12:31:04Z")

</div>

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