Created
August 3, 2016 11:11
-
-
Save jprante/efc3ef7988e89c1b859fcced4c99da61 to your computer and use it in GitHub Desktop.
Parent/child
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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