Enforcing mapped types

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

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Enforcing-mapped-types-tp3220227p3220227.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.