Created
November 16, 2012 19:46
-
-
Save jprante/4090274 to your computer and use it in GitHub Desktop.
Magic Mapping ?
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
# value-style before object-style => "auto upgrade" | |
curl -XDELETE 'http://localhost:9200/test' | |
curl -XPUT 'localhost:9200/test/test/1' -d ' | |
{ | |
"obj" : "value" | |
} | |
' | |
curl -XGET 'localhost:9200/test/_refresh' | |
curl -XPUT 'localhost:9200/test/test/2' -d ' | |
{ | |
"obj" : { "key" : "value" } | |
} | |
' | |
curl -XGET 'localhost:9200/test/_refresh' | |
# 2 hits for '*' | |
curl -XGET 'localhost:9200/test/_search?q=*&pretty=1' | |
# 1 hit for 'obj' | |
curl -XGET 'localhost:9200/test/_search?q=obj:*&pretty=1' | |
# 0 hit for 'key' | |
curl -XGET 'localhost:9200/test/_search?q=key:*&pretty=1' | |
# object-style before value-style => MapperParsingException | |
curl -XDELETE 'http://localhost:9200/test' | |
curl -XPUT 'localhost:9200/test/test/2' -d ' | |
{ | |
"obj" : { "key" : "value" } | |
} | |
' | |
curl -XGET 'localhost:9200/test/_refresh' | |
curl -XPUT 'localhost:9200/test/test/1' -d ' | |
{ | |
"obj" : "value" | |
} | |
' | |
curl -XGET 'localhost:9200/test/_refresh' | |
# 1 hit | |
curl -XGET 'localhost:9200/test/_search?q=*&pretty=1' | |
# 0 hits for 'obj' | |
curl -XGET 'localhost:9200/test/_search?q=obj:*&pretty=1' | |
# 1 hit for 'key' | |
curl -XGET 'localhost:9200/test/_search?q=key:*&pretty=1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment