Skip to content

Instantly share code, notes, and snippets.

@dadoonet
Last active December 29, 2015 16:38
Show Gist options
  • Save dadoonet/7698308 to your computer and use it in GitHub Desktop.
Save dadoonet/7698308 to your computer and use it in GitHub Desktop.
curl -XDELETE "http://localhost:9200/anindex"; echo
curl -XPUT "http://localhost:9200/anindex/atype/1" -d'
{
"obj1":
{
"foo" : "bar"
},
"obj2" :
{
"baz" : "qux"
}
}'; echo
curl -XGET "http://localhost:9200/anindex/_mapping"; echo
# {"anindex":{"atype":{"properties":{"obj1":{"properties":{"foo":{"type":"string"}}},"obj2":{"properties":{"baz":{"type":"string"}}}}}}}
curl -XDELETE "http://localhost:9200/anindex"; echo
curl -XPUT "http://localhost:9200/anindex/atype/1" -d'
{
"atype":
{
"foo" : "bar"
},
"obj2" :
{
"baz" : "qux"
}
}'; echo
curl -XGET "http://localhost:9200/anindex/_mapping"; echo
# {"anindex":{"atype":{"properties":{"foo":{"type":"string"}}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment