Skip to content

Instantly share code, notes, and snippets.

@jprante
Created August 3, 2016 11:11
Show Gist options
  • Save jprante/efc3ef7988e89c1b859fcced4c99da61 to your computer and use it in GitHub Desktop.
Save jprante/efc3ef7988e89c1b859fcced4c99da61 to your computer and use it in GitHub Desktop.
Parent/child
DELETE /myindex
PUT /myindex/
{
"mappings": {
"error" : {
"_parent" : {
"type" : "activitytype"
}
}
}
}
PUT /myindex/activitytype/1
{
"message": "I am a parent"
}
PUT /myindex/error/1?parent=1
{
"message": "I am a child"
}
POST /myindex/activitytype/_search
{
"query": {
"has_child": {
"type": "error",
"query": {
"match": {
"_all": "child"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment