Bulk upsert with _id path rather than explicit _id

Hello experts,

I'm trying to do a bulk upsert with an _id path on ES 0.90.3. This saves
me the need to explicitly state the _id at upsert time. However, I can't
seem to get it working and I'm sure I'm doing something silly.
Any help would be greatly appreciated

Thanks!
-Val

curl -XPOST http://localhost:9200/val123 -d {}
echo "Should be fine"
curl -XPOST http://localhost:9200/val123/tweet/_mapping -d '{ "tweet" : {
"_id" : { "path" : "post_id" } } }'
echo "Should be fine"

curl -XPOST http://localhost:9200/val123/tweet/_bulk -d '
{"update":{}}
{"doc": {"message" : "You know, for Search", "post_id" : "123"},
"doc_as_upsert": true}
'
echo 'Should throw error:
{"error":"ActionRequestValidationException[Validation Failed: 1: id is
missing;]","status":500}'

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yeah. Bulk process does not read document content but only headers and then pass content (index/update/delete request) to the right shard.
To extract the right shard, we need to know the _id without parsing the body itself.

I'm afraid you must provide it.

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 13 août 2013 à 15:55, Val Vakar val.vakar@gmail.com a écrit :

Hello experts,

I'm trying to do a bulk upsert with an _id path on ES 0.90.3. This saves me the need to explicitly state the _id at upsert time. However, I can't seem to get it working and I'm sure I'm doing something silly.
Any help would be greatly appreciated

Thanks!
-Val

curl -XPOST http://localhost:9200/val123 -d {}
echo "Should be fine"
curl -XPOST http://localhost:9200/val123/tweet/_mapping -d '{ "tweet" : { "_id" : { "path" : "post_id" } } }'
echo "Should be fine"

curl -XPOST http://localhost:9200/val123/tweet/_bulk -d '
{"update":{}}
{"doc": {"message" : "You know, for Search", "post_id" : "123"}, "doc_as_upsert": true}
'
echo 'Should throw error: {"error":"ActionRequestValidationException[Validation Failed: 1: id is missing;]","status":500}'

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.