Last active
December 11, 2015 18:43
-
-
Save coolacid/14570b3ce673dcf3f428 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
# Tested against 2.1.0 and 1.7.3 | |
# Create the first document - note, string is a quoted | |
curl -XPUT 'http://localhost:9200/testindex/test/1' -d '{ | |
"data": "test", | |
"number" : 1, | |
"string" : "0" | |
}' | |
# Create the second document - note, string is NOT quoted | |
curl -XPUT 'http://localhost:9200/testindex/test/2' -d '{ | |
"data": "test", | |
"number" : 1, | |
"string" : 0 | |
}' | |
sleep 5 #Wait for index to happen | |
# Mapping shows string to be mapped to a string | |
curl -XGET 'http://localhost:9200/testindex/_mapping?pretty' | |
# However, elasticsearch returns a number for 2 | |
curl -XGET 'http://localhost:9200/testindex/test/1' | |
curl -XGET 'http://localhost:9200/testindex/test/2' | |
curl -XDELETE 'http://localhost:9200/testindex' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment