Skip to content

Instantly share code, notes, and snippets.

@ppearcy
Last active December 16, 2015 00:39
Show Gist options
  • Save ppearcy/5349703 to your computer and use it in GitHub Desktop.
Save ppearcy/5349703 to your computer and use it in GitHub Desktop.
It looks like there can be some implicit conflicts around index_name and multi-fields. This is likely an edge case, but could cause some very funky behavior.
curl -XDELETE 'http://localhost:9200/test/'
curl -XPOST localhost:9200/test/ -d '{
"mappings" : {
"test":{
"properties" : {
"multi_test" : {"type":"string", "index_name":"multi_test.string"}
}
}}
}
}'
curl -XPOST localhost:9200/test/test/_mapping -d '{
"test":{
"properties" : {
"multi_test" : {
"type":"multi_field",
"fields": {
"string" : {"type" : "string", "index_name":"multi_test.string"},
"multi_test" : {"type":"float", "index_name":"multi_test.float"}
}
}
}
}
}'
curl -XPUT localhost:9200/test/test/1 -d'{
"multi_test": "10000"
}'
curl -XPOST 'http://localhost:9200/test/_refresh'
curl 'http://localhost:9200/test/test/_search?q=multi_test:*'
curl 'http://localhost:9200/test/test/_search?q=*:*'
curl -XPUT localhost:9200/test/test/1 -d'{
"test": "10000"
}'
-- Here is working example without index_name
curl -XDELETE 'http://localhost:9200/test/'
curl -XPOST localhost:9200/test/ -d '{
"mappings" : {
"test":{
"properties" : {
"multi_test" : {"type":"string"}
}
}}
}
}'
curl -XPOST localhost:9200/test/test/_mapping -d '{
"test":{
"properties" : {
"multi_test" : {
"type":"multi_field",
"fields": {
"string" : {"type" : "string"},
"multi_test" : {"type":"float"}
}
}
}
}
}'
curl -XPUT localhost:9200/test/test/1 -d'{
"multi_test": "10000"
}'
curl -XPOST 'http://localhost:9200/test/_refresh'
curl 'http://localhost:9200/test/test/_search?q=multi_test:*'
curl 'http://localhost:9200/test/test/_search?q=*:*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment