Last active
August 29, 2015 14:01
-
-
Save fabianvf/fb8ffd17bf5b6f180d88 to your computer and use it in GitHub Desktop.
Marvel commands for dummy hierarchy in ElasticSearch
This file contains 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
GET _search | |
{ | |
"query": { | |
"match_all": {} | |
} | |
} | |
DELETE website | |
PUT website | |
{ | |
"mappings": { | |
"project" : { | |
"name" : { | |
"type":"string" | |
}, | |
"pid":{ | |
"type" : "string" | |
} | |
}, | |
"wiki" : { | |
"_parent" : { | |
"type" : "project" | |
}, | |
"name": { | |
"type" : "string" | |
}, | |
"wid": { | |
"type":"string" | |
} | |
} | |
} | |
} | |
GET website/_mapping | |
GET website/project/_mapping | |
GET website/wiki/_mapping | |
POST website/project/1 | |
{ | |
"name": "Project 1", | |
"pid": "1" | |
} | |
DELETE website/project/1 | |
POST website/wiki/1?parent=1 | |
{ | |
"name" : "Project 1 Wiki", | |
"wid" : "1" | |
} | |
DELETE website/wiki/1 | |
POST website/project/2 | |
{ | |
"name": "Project 2", | |
"pid": "2" | |
} | |
DELETE website/project/2 | |
POST website/wiki/2?parent=2 | |
{ | |
"name" : "Project 2 Wiki", | |
"wid" : "2" | |
} | |
DELETE website/wiki/2 | |
GET _search | |
{ | |
"query": { | |
"has_parent" : { | |
"type": "project" | |
, "query": { | |
"match_all": {} | |
} | |
} | |
} | |
} | |
GET _search | |
{ | |
"query": { | |
"has_child" : { | |
"type": "wiki" | |
, "query": { | |
"match_all": {} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment