# Whats different with 'index' and 'create' of Bulk API

**URL:** https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240
**Category:** Elasticsearch
**Created:** [December 3, 2015, 3:18am UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240 "2015-12-03T03:18:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jason\_Zheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zheng/32/4041_2.png) [@Jason\_Zheng](https://discuss.elastic.co/u/Jason_Zheng)
#### Post date: [December 3, 2015, 3:18am UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240/1 "2015-12-03T03:18:59Z")

</div>

Hi all,

I tried Bulk API from the document as

> ```
> { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
> { "field1" : "value1" }
> { "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
> { "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } }
> { "field1" : "value3" }
> { "update" : {"_id" : "1", "_type" : "type1", "_index" : "index1"} }
> { "doc" : {"field2" : "value2"} }
> 
> ```

I set action.auto\_create\_index: false in config/elasticsearch.yml, but I don't understand whats different with 'index' and 'create', because both of them, which the response returns as :

> "error" : "IndexMissingException[[test] missing]"

Some one can explain it?

Jason

---

<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: [December 3, 2015, 5:13am UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240/2 "2015-12-03T05:13:08Z")

</div>

You can't create an index in a bulk request, you need to do it externally cause you have `action.auto_create_index: false`.

---

<div class="post-metadata">

### Author: ![Jason\_Zheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zheng/32/4041_2.png) [@Jason\_Zheng](https://discuss.elastic.co/u/Jason_Zheng)
#### Post date: [December 3, 2015, 10:35am UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240/3 "2015-12-03T10:35:27Z")

</div>

Hi Mark,

Thanks.

If the index exists, whats different with 'create' and 'index'?

Jason

---

<div class="post-metadata">

### Author: ![sandros](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sandros/32/6348_2.png) [@sandros](https://discuss.elastic.co/u/sandros)
#### Post date: [December 3, 2015, 11:01am UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240/4 "2015-12-03T11:01:37Z")

</div>

See here:  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index\_.html#operation-type](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html#operation-type)

If you use create if a doc with that id already exists, if you use index it will create a document or update it if xisting.

---

<div class="post-metadata">

### Author: ![Jason\_Zheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jason_zheng/32/4041_2.png) [@Jason\_Zheng](https://discuss.elastic.co/u/Jason_Zheng)
#### Post date: [December 3, 2015, 2:57pm UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240/5 "2015-12-03T14:57:05Z")

</div>

Thanks you, its helpful

---

<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: [July 5, 2017, 11:33pm UTC](https://discuss.elastic.co/t/whats-different-with-index-and-create-of-bulk-api/36240/6 "2017-07-05T23:33:50Z")

</div>


