# Strange bulk index results

**URL:** <https://discuss.elastic.co/t/strange-bulk-index-results/6036>\
**Category:** Elasticsearch\
**Created:** [December 1, 2011, 8:26am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036 "2011-12-01T08:26:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ko526so](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@ko526so](https://discuss.elastic.co/u/ko526so)\
**Post date:** [December 1, 2011, 8:26am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/1 "2011-12-01T08:26:39Z")

</div>

I have strange bulk index results with 0.18.5.  
Let me explain step by step.

1. The followings are my bulk file.

$ cat bulktest3  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "1", "user" : "aaa" } }  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "2", "user" : "bbb" } }  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "3", "user" : "ccc" } }  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "4", "user" : "ddd" } }  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "5", "user" : "xxx" } }  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "6", "user" : "yyy" } }  
{ "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "7", "user" : "zzz" } }

1. I indexed using the following curl command.

$ curl -XPUT '[http://localhost:9200/\_bulk/](http://localhost:9200/_bulk/)' --data-binary @bulktest3  
{"took":622,"items":[{"index":{"\_index":"twitter","\_type":"tweet","\_id":"1","\_version":1,"ok":true}},{"index":{"\_index":"twitter","\_type":"tweet","\_id":"3","\_version":1,"ok":true}},{"index":{"\_index":"twitter","\_type":"tweet","\_id":"5","\_version":1,"ok":true}},{"index":{"\_index":"twitter","\_type":"tweet","\_id":"7","error":"ElasticSearchParseException[Failed to derive xcontent from (offset=0, length=0): []]"}}]}

1. Unfortunately, I got several errors. Only 3 out of 7 rows are indexed.

$ curl -XGET '[http://localhost:9200/twitter/\_search?pretty=true&q=\*](http://localhost:9200/twitter/_search?pretty=true&q=*)'  
{  
"took" : 12,  
"timed\_out" : false,  
"\_shards" : {  
"total" : 20,  
"successful" : 20,  
"failed" : 0  
},  
"hits" : {  
"total" : 3,  
"max\_score" : 1.0,  
"hits" : [ {  
"\_index" : "twitter",  
"\_type" : "tweet",  
"\_id" : "1",  
"\_score" : 1.0, "\_source" : { "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "2", "user" : "bbb" } }  
}, {  
"\_index" : "twitter",  
"\_type" : "tweet",  
"\_id" : "3",  
"\_score" : 1.0, "\_source" : { "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "4", "user" : "ddd" } }  
}, {  
"\_index" : "twitter",  
"\_type" : "tweet",  
"\_id" : "5",  
"\_score" : 1.0, "\_source" : { "index" : { "\_index" : "twitter", "\_type" : "tweet", "\_id" : "6", "user" : "yyy" } }  
} ]  
}

I have tested with other files either though, STRANGELY, even rows(2, 4, 6...) got indexed always.  
Is this a bug or am I wrong?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Njal\_Karevoll1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/njal_karevoll1/32/1932_2.png) [@Njal\_Karevoll1](https://discuss.elastic.co/u/Njal_Karevoll1)\
**Post date:** [December 1, 2011, 9:28am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/2 "2011-12-01T09:28:49Z")

</div>

See [http://www.elasticsearch.org/guide/reference/api/bulk.html](http://www.elasticsearch.org/guide/reference/api/bulk.html), the first  
line is a action+metadata line, the second line should be your document.  
(Also note that deletes does not contain a source body, and the line  
following a delete action line is another action+metadata line)

---

<div class="post-metadata">

**Author:** ![ko526so](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@ko526so](https://discuss.elastic.co/u/ko526so)\
**Post date:** [December 1, 2011, 9:38am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/3 "2011-12-01T09:38:56Z")

</div>

However, the following link used the same format that I used!

> **[Solr vs elasticsearch Deathmatch!](https://dmurphy747.wordpress.com/2011/04/02/solr-vs-elasticsearch-deathmatch/)**
>
> Solr vs elasticsearch If you need good full-text search or faceted search, Apache Solr has been the standard.  I’ve used it myself for three projects in the past, and it is indeed a very powe…

hmm....

--  
View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/Strange-bulk-index-results-tp3550865p3551016.html](http://elasticsearch-users.115913.n3.nabble.com/Strange-bulk-index-results-tp3550865p3551016.html)  
Sent from the ElasticSearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![ko526so](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@ko526so](https://discuss.elastic.co/u/ko526so)\
**Post date:** [December 1, 2011, 9:40am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/4 "2011-12-01T09:40:37Z")

</div>

However, the following link used the same format that I used!

> **[Solr vs elasticsearch Deathmatch!](https://dmurphy747.wordpress.com/2011/04/02/solr-vs-elasticsearch-deathmatch/)**
>
> Solr vs elasticsearch If you need good full-text search or faceted search, Apache Solr has been the standard.  I’ve used it myself for three projects in the past, and it is indeed a very powe…

hmm....

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [December 1, 2011, 9:59am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/5 "2011-12-01T09:59:03Z")

</div>

On Thu, 2011-12-01 at 01:40 -0800, ko526so wrote:

> However, the following link used the same format that I used!
> 
> [Solr vs elasticsearch Deathmatch! | dmurphy747](http://dmurphy747.wordpress.com/2011/04/02/solr-vs-elasticsearch-deathmatch/)

Seriously, that link is better ignored. It is so full of errors...

> hmm....

---

<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:** [December 1, 2011, 10:19am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/6 "2011-12-01T10:19:34Z")

</div>

> > [Solr vs elasticsearch Deathmatch! | dmurphy747](http://dmurphy747.wordpress.com/2011/04/02/solr-vs-elasticsearch-deathmatch/)
> 
> Seriously, that link is better ignored. It is so full of errors...

Sure and BTW he didn't compare search performances while indexing !  
ES is blazzing fast even with high bulk loading !!!

--  
David Pilato  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet

---

<div class="post-metadata">

**Author:** ![ko526so](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@ko526so](https://discuss.elastic.co/u/ko526so)\
**Post date:** [December 1, 2011, 10:22am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/7 "2011-12-01T10:22:08Z")

</div>

It works as Njal and Clinton said!  
Thanks guys.

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 1, 2011, 4:25pm UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/8 "2011-12-01T16:25:59Z")

</div>

Worst, I tried to comment on the blog post several times, just to point the  
errors, and it never gets accepted...

On Thu, Dec 1, 2011 at 12:19 PM, [david@pilato.fr](mailto:david@pilato.fr) [david@pilato.fr](mailto:david@pilato.fr) wrote:

> \*\*
> 
> > >
> 
> [Solr vs elasticsearch Deathmatch! | dmurphy747](http://dmurphy747.wordpress.com/2011/04/02/solr-vs-elasticsearch-deathmatch/)
> 
> > Seriously, that link is better ignored. It is so full of errors...
> 
> Sure and BTW he didn't compare search performances while indexing !
> 
> ES is blazzing fast even with high bulk loading !!!
> 
> --  
> David Pilato  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet

---

<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 6, 2017, 3:46am UTC](https://discuss.elastic.co/t/strange-bulk-index-results/6036/9 "2017-07-06T03:46:42Z")

</div>


