Skip to content

Instantly share code, notes, and snippets.

@jprante
Last active January 1, 2016 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jprante/8174209 to your computer and use it in GitHub Desktop.
Save jprante/8174209 to your computer and use it in GitHub Desktop.
Parent ID cache and _refresh
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": {
}
}
}
}
}
'
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