Last active
January 1, 2016 16:59
-
-
Save jprante/8174209 to your computer and use it in GitHub Desktop.
Parent ID cache and _refresh
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
curl -XDELETE 'http://localhost:9200/test__garments' | |
curl -XPOST 'http://localhost:9200/test__garments/garment/1' -d ' | |
{ | |
"id":1, "name":"Some Garment" | |
} | |
' | |
curl -XPOST 'http://localhost:9200/test__garments/_refresh' | |
curl -XPOST 'http://localhost:9200/test__garments/verdict/_mapping' -d ' | |
{ | |
"verdict" : { | |
"_parent": { "type":"garment"}, | |
"properties": { | |
"id" : {"type":"integer"} | |
} | |
} | |
} | |
' | |
curl -XPOST 'http://localhost:9200/test__garments/_refresh' | |
curl -XPOST 'http://localhost:9200/test__garments/verdict/1?parent=1' -d ' | |
{ | |
"id":1 | |
} | |
' | |
curl -XPOST 'http://localhost:9200/test__garments/_refresh' | |
curl -XPOST 'http://localhost:9200/_cache/clear?id_cache=true' | |
curl -XPOST 'http://localhost:9200/test__garments/verdict/_search/' -d ' | |
{ | |
"query": { | |
"has_parent": { | |
"type": "garment", | |
"query": { | |
"match_all": { | |
} | |
} | |
} | |
} | |
} | |
' |
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
curl -XDELETE 'http://localhost:9200/test__garments' | |
curl -XPUT 'http://localhost:9200/test__garments' -d ' | |
{ | |
"mappings": { | |
"garment" : { | |
}, | |
"verdict" : { | |
"_parent": { "type":"garment"}, | |
"properties": { | |
"id" : {"type":"integer"} | |
} | |
} | |
} | |
} | |
' | |
curl -XPOST 'http://localhost:9200/test__garments/_refresh' | |
curl -XPOST 'http://localhost:9200/test__garments/garment/1' -d ' | |
{ | |
"id":1, "name":"Some Garment" | |
} | |
' | |
curl -XPOST 'http://localhost:9200/test__garments/_refresh' | |
curl -XPOST 'http://localhost:9200/test__garments/verdict/1?parent=1' -d ' | |
{ | |
"id":1 | |
} | |
' | |
curl -XPOST 'http://localhost:9200/test__garments/_refresh' | |
curl -XPOST 'http://localhost:9200/test__garments/verdict/_search' -d ' | |
{ | |
"query": { | |
"has_parent": { | |
"type": "garment", | |
"query": { | |
"match_all": {} | |
} | |
} | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment