Skip to content

Instantly share code, notes, and snippets.

@edwardsmit
Created May 18, 2017 07:05
Show Gist options
  • Save edwardsmit/6aad415a500ab17522f506cb69cfa3ec to your computer and use it in GitHub Desktop.
Save edwardsmit/6aad415a500ab17522f506cb69cfa3ec to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
curl -XDELETE 'localhost:9200/maptest'
curl -XPOST 'localhost:9200/maptest/_refresh?pretty'
curl -XPUT 'localhost:9200/maptest?pretty' -H 'Content-Type: application/json' -d'
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
"mappings" : {
"test": {
"dynamic": "strict",
"properties": {
"optionTrace": {
"dynamic": true,
"type": "object"
}
}
}
}
}
'
curl -XPOST 'localhost:9200/maptest/test' -H 'Content-Type: application/json' -d'
{
"optionTrace": {
"newPrices": {
"optionrule": {
"basePriceNet": 1234.5643
}
}
}
}
'
curl -XPOST 'localhost:9200/maptest/_refresh?pretty'
curl -XPOST 'localhost:9200/maptest/test' -H 'Content-Type: application/json' -d'
{
"optionTrace": {
"newPrices": {
"optionrule": {
"basePriceNet": 1234
}
}
}
}
'
curl -XPOST 'localhost:9200/maptest/_refresh?pretty'
curl -XPOST 'localhost:9200/maptest/test' -H 'Content-Type: application/json' -d'
{
"optionTrace": {
"newPrices": {
"optionrule": {
"retailprice": 1234
}
}
}
}
'
curl -XPOST 'localhost:9200/maptest/_refresh?pretty'
curl -XPOST 'localhost:9200/maptest/test' -H 'Content-Type: application/json' -d'
{
"optionTrace": {
"newPrices": {
"optionrule": {
"retailprice": 1234.4567
}
}
}
}
'
curl -XPOST 'localhost:9200/maptest/_refresh?pretty'
curl -XGET 'localhost:9200/maptest/test/_search?pretty'
curl -XGET 'localhost:9200/maptest/_mapping?pretty'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment