Created
May 18, 2017 07:05
-
-
Save edwardsmit/6aad415a500ab17522f506cb69cfa3ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/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