# Bulk API returning create results for index operation in 2.3.1

**URL:** https://discuss.elastic.co/t/bulk-api-returning-create-results-for-index-operation-in-2-3-1/69923
**Category:** Elasticsearch
**Created:** [December 23, 2016, 6:52pm UTC](https://discuss.elastic.co/t/bulk-api-returning-create-results-for-index-operation-in-2-3-1/69923 "2016-12-23T18:52:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![anon12945697](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@anon12945697](https://discuss.elastic.co/u/anon12945697)
#### Post date: [December 23, 2016, 6:52pm UTC](https://discuss.elastic.co/t/bulk-api-returning-create-results-for-index-operation-in-2-3-1/69923/1 "2016-12-23T18:52:24Z")

</div>

Hi,

I just found a weird return result in ES 2.3.1. I sent the following request to bulk API:

> {"index":{"\_index":"slabtest-2016.12.23","\_type":"etw"}}  
> {"EventId":0,"EventDate":"2016-12-23T18:28:41.8426958Z","Keywords":0,"ProviderId":"00000000-0000-0000-0000-000000000000","ProviderName":null,"InstanceName":"instance","Level":0,"LevelName":"LogAlways","Message":null,"Opcode":0,"Task":0,"Version":0,"ProcessId":0,"ThreadId":0,"Payload\_msg":"1","Payload\_date":"2016-12-23T18:28:41.8426958Z"}  
> {"index":{"\_index":"slabtest-2016.12.23","\_type":"etw"}}  
> {"EventId":0,"EventDate":"2016-12-23T18:28:41.8446948Z","Keywords":0,"ProviderId":"00000000-0000-0000-0000-000000000000","ProviderName":null,"InstanceName":"instance","Level":0,"LevelName":"LogAlways","Message":null,"Opcode":0,"Task":0,"Version":0,"ProcessId":0,"ThreadId":0,"Payload\_msg":"2","Payload\_date":"2016-12-23T18:28:41.8446948Z"}  
> {"index":{"\_index":"slabtest-2016.12.23","\_type":"etw"}}  
> {"EventId":0,"EventDate":"2016-12-23T18:28:41.8446948Z","Keywords":0,"ProviderId":"00000000-0000-0000-0000-000000000000","ProviderName":null,"InstanceName":"instance","Level":0,"LevelName":"LogAlways","Message":null,"Opcode":0,"Task":0,"Version":0,"ProcessId":0,"ThreadId":0,"Payload\_msg":"3","Payload\_date":"2016-12-23T18:28:41.8446948Z"}

I was expecting results of index operation, but I got results of create operation.  
I have tested it on Cloud and a Windows single node, both are returning the same result. On Windows 5.0.2 and 5.1.1, the results are correct.

Is it a bug? How can I collect more info if needed?

Thanks.

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [December 23, 2016, 8:44pm UTC](https://discuss.elastic.co/t/bulk-api-returning-create-results-for-index-operation-in-2-3-1/69923/2 "2016-12-23T20:44:35Z")

</div>

> [@anon12945697](#):
>
> I got results of create operation.

Without the output I can't really tell what you mean. If it is different in 5.0.2 and 5.1.1 then it might be a bug, but not a high enough priority one to backport to 2.x. Or just a difference between the two versions.

---

<div class="post-metadata">

### Author: ![anon12945697](https://avatars.discourse-cdn.com/v4/letter/a/74df32/32.png) [@anon12945697](https://discuss.elastic.co/u/anon12945697)
#### Post date: [December 27, 2016, 2:28pm UTC](https://discuss.elastic.co/t/bulk-api-returning-create-results-for-index-operation-in-2-3-1/69923/3 "2016-12-27T14:28:36Z")

</div>

The bulk api request is 3 index operations:

```
{"index":{"_index":"slabtest-2016.12.27","_type":"etw"}}
{"EventId":0,"EventDate":"2016-12-27T14:18:12.7423148Z","Keywords":0,"ProviderId":"00000000-0000-0000-0000-000000000000","ProviderName":null,"InstanceName":"instance","Level":0,"LevelName":"LogAlways","Message":null,"Opcode":0,"Task":0,"Version":0,"ProcessId":0,"ThreadId":0,"Payload_msg":"1","Payload_date":"2016-12-27T14:18:12.7423148Z"}
{"index":{"_index":"slabtest-2016.12.27","_type":"etw"}}
{"EventId":0,"EventDate":"2016-12-27T14:18:12.7423148Z","Keywords":0,"ProviderId":"00000000-0000-0000-0000-000000000000","ProviderName":null,"InstanceName":"instance","Level":0,"LevelName":"LogAlways","Message":null,"Opcode":0,"Task":0,"Version":0,"ProcessId":0,"ThreadId":0,"Payload_msg":"2","Payload_date":"2016-12-27T14:18:12.7423148Z"}
{"index":{"_index":"slabtest-2016.12.27","_type":"etw"}}
{"EventId":0,"EventDate":"2016-12-27T14:18:12.7423148Z","Keywords":0,"ProviderId":"00000000-0000-0000-0000-000000000000","ProviderName":null,"InstanceName":"instance","Level":0,"LevelName":"LogAlways","Message":null,"Opcode":0,"Task":0,"Version":0,"ProcessId":0,"ThreadId":0,"Payload_msg":"3","Payload_date":"2016-12-27T14:18:12.7423148Z"}

```

Here are the result in 2.3.1:

```
{
    "took":1309,
    "errors":false,
    "items":[
        {
            "create":{
                "_index":"slabtest-2016.12.27",
                "_type":"etw",
                "_id":"AVlAmvxnpgQrdcZHT7Z4",
                "_version":1,
                "_shards":{
                    "total":2,
                    "successful":1,
                    "failed":0
                },
                "status":201
            }
        },
        {
            "create":{
                "_index":"slabtest-2016.12.27",
                "_type":"etw",
                "_id":"AVlAmvxnpgQrdcZHT7Z5",
                "_version":1,
                "_shards":{
                    "total":2,
                    "successful":1,
                    "failed":0
                },
                "status":201
            }
        },
        {
            "create":{
                "_index":"slabtest-2016.12.27",
                "_type":"etw",
                "_id":"AVlAmvxnpgQrdcZHT7Z6",
                "_version":1,
                "_shards":{
                    "total":2,
                    "successful":1,
                    "failed":0
                },
                "status":201
            }
        }
    ]
}

```

And here is the result in 5.0.2 and 5.1.1:

```
{
    "took":1405,
    "errors":false,
    "items":[
        {
            "index":{
                "_index":"slabtest-2016.12.27",
                "_type":"etw",
                "_id":"AVlApVP6d2ep14HstVjy",
                "_version":1,
                "result":"created",
                "_shards":{
                    "total":2,
                    "successful":1,
                    "failed":0
                },
                "created":true,
                "status":201
            }
        },
        {
            "index":{
                "_index":"slabtest-2016.12.27",
                "_type":"etw",
                "_id":"AVlApVP6d2ep14HstVjz",
                "_version":1,
                "result":"created",
                "_shards":{
                    "total":2,
                    "successful":1,
                    "failed":0
                },
                "created":true,
                "status":201
            }
        },
        {
            "index":{
                "_index":"slabtest-2016.12.27",
                "_type":"etw",
                "_id":"AVlApVP6d2ep14HstVj0",
                "_version":1,
                "result":"created",
                "_shards":{
                    "total":2,
                    "successful":1,
                    "failed":0
                },
                "created":true,
                "status":201
            }
        }
    ]
}

```

The ES reply in 2.3.1 is confusing. Why am I getting **create** instead of **index**?

---

<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: [January 24, 2017, 2:28pm UTC](https://discuss.elastic.co/t/bulk-api-returning-create-results-for-index-operation-in-2-3-1/69923/4 "2017-01-24T14:28:50Z")

</div>

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