Quick question: I've created a very simple mapping of a field to be an
integer. A get of the _mapping shows the following:
$ curl -x '' -XGET 'http://localhost:9200/maptest/test/_mapping?
pretty=true'
{
"test" : {
"properties" : {
"name" : {
"type" : "string"
},
"int_test" : {
"store" : "yes",
"type" : "integer"
}
}
}
}
However, it doesn't seem that the mapping is being enforced. If I
create an object with a float or string value, it is accepted, and
future GETs have the same float or string. i.e.:
$ curl -x '' -XPOST 'http://localhost:9200/maptest/test' -d
'{ "name" : "whatever", "int_test" : 5.22 }'
{"ok":true,"_index":"maptest","_type":"test","_id":"oO3ShWAlQp693b4b4mW3UQ","_version":
1}
$curl -x '' -XGET 'http://localhost:9200/maptest/test/
oO3ShWAlQp693b4b4mW3UQ'
{"_index":"maptest","_type":"test","_id":"oO3ShWAlQp693b4b4mW3UQ","_version":
1,"exists":true, "_source" : { "name" : "whatever", "int_test" :
5.22 }}
$ curl -x '' -XGET 'http://localhost:9200/maptest/test/
oO3ShWAlQp693b4b4mW3UQ?fields=int_test'
{"_index":"maptest","_type":"test","_id":"oO3ShWAlQp693b4b4mW3UQ","_version":
1,"exists":true,"fields":{"int_test":5.22}}
What am I missing?
Thanks,
- Ruben
Also, sorry I've posted this a few times.... was having trouble having
nabble recognize my subscription.