Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Insert GrandChildren
# Insert GrandChildren for the Fords
curl -X PUT \
'http://localhost:9200/family_tree/_bulk?routing=Darren' -H 'content-type: application/json' \
-d '
{"index": {"_type": "_doc", "_id": "14"}}
{"firstName":"Douglas", "lastName":"Ford", "gender":"Male", "isAlive":true, "relation_type":{ "name":"grandchild", "parent":"5" } }
'
# Insert GrandChildren for the Turners
curl -X PUT \
'http://localhost:9200/family_tree/_bulk?routing=Ryan' -H 'content-type: application/json' \
-d '
{"index": {"_type": "_doc", "_id": "15"}}
{"firstName":"Frederick", "lastName":"Turner", "gender":"Male", "isAlive":false, "relation_type":{ "name":"grandchild", "parent":"11" } }
{"index": {"_type": "_doc", "_id": "16"}}
{"firstName":"Eleanor", "lastName":"Turner", "gender":"Female", "isAlive":false, "relation_type":{ "name":"grandchild", "parent":"11" } }
{"index": {"_type": "_doc", "_id": "17"}}
{"firstName":"Troy", "lastName":"Turner", "gender":"Male", "isAlive":false, "relation_type":{ "name":"grandchild", "parent":"11" } }
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.