Created
June 8, 2012 22:01
-
-
Save kimchy/2898285 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
curl -XPUT localhost:9200/test | |
curl -XPUT http://localhost:9200/test/data/_mapping -d '{ | |
"data" : { | |
"dynamic_templates" : [ | |
{ | |
"string_template" : { | |
"match" : "*", | |
"match_mapping_type" : "string", | |
"mapping" : { | |
"type" : "multi_field", | |
"fields" : { | |
"{name}" : {"type": "string", "index" : "analyzed", "analyzer" : "default", "store" : "false", "include_in_all": "true"}, | |
"{name}_untouched" : {"type": "string", "index" : "analyzed", "analyzer" : "simple", "store" : "false"} | |
} | |
} | |
} | |
} | |
] | |
} | |
}' |
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
curl -XPUT http://localhost:9200/test -d '{ | |
"mappings" : { | |
"_default_" : { | |
"dynamic_templates" : [ | |
{ | |
"string_template" : { | |
"match" : "*", | |
"match_mapping_type" : "string", | |
"mapping" : { | |
"type" : "multi_field", | |
"fields" : { | |
"{name}" : {"type": "string", "index" : "analyzed", "analyzer" : "default", "store" : "false", "include_in_all": "true"}, | |
"{name}_untouched" : {"type": "string", "index" : "analyzed", "analyzer" : "simple", "store" : "false", "include_in_all": "true"} | |
} | |
} | |
} | |
} | |
] | |
} | |
} | |
}' | |
When I now add an object: | |
curl -XPUT http://localhost:9200/test/data/1 -d '{ | |
"name" : "michael", | |
"company" : { | |
name: "foobar" | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thx!