Skip to content

Instantly share code, notes, and snippets.

@merrellb
Created January 20, 2011 09:37
Show Gist options
  • Save merrellb/787646 to your computer and use it in GitHub Desktop.
Save merrellb/787646 to your computer and use it in GitHub Desktop.
Elastic Search problems with indexing documents with parents using bulk
curl -XPOST localhost:9200/test -d '
{
"mappings" : {
"prediction" : {
"_parent" : {
"type" : "doc"
}
}
}
}
'
curl -XPOST localhost:9200/_bulk -d '
{ "index" : { "_index" : "test", "_type": "doc", "_id" : "1" } }
{ "doc" : { "name" : "my_name" } }
'
curl -XPOST localhost:9200/_bulk -d '
{ "index" : { "_index" : "test", "_type": "prediction" }
{ "prediction" : { "_parent": "1", "val" : 0.2 } }
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment