Strange bulk index results


(ko526so) #1

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/' --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=*'
{
"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.


(Njål Karevoll) #2

See 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)


(ko526so) #3

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

hmm....

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


(ko526so) #4

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

hmm....


(Clinton Gormley) #5

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

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

http://dmurphy747.wordpress.com/2011/04/02/solr-vs-elasticsearch-deathmatch/

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

hmm....


(David Pilato) #6

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/
Twitter : @dadoonet


(ko526so) #7

It works as Njal and Clinton said!
Thanks guys.


(Shay Banon) #8

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 david@pilato.fr wrote:

**

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/
Twitter : @dadoonet


(system) #9