Strings coerce to numbers failed

I enter the code like elasticsearch example, but the coerce result is wrong.

PUT my_index
{
"settings": {
"index.mapping.coerce": true
},
"mappings": {
"my_type": {
"properties": {
"number_one": {
"type": "integer"
},
"number_two": {
"type": "integer",
"coerce": false
}
}
}
}
}

PUT my_index/my_type/1
{ "number_one": "10" }

GET my_index/my_type/_search

the result:

{
"took": 7,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "my_index",
"_type": "my_type",
"_id": "1",
"_score": 1,
"_source": {
"number_one": "10"
}
}
]
}
}

no convertion happened, why?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.