Last active
December 16, 2015 00:39
-
-
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.
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
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