Changing datatype

Hi,

How can we change the mapped data type , from string to integer.

$ curl -XPUT 'http://localhost:9200/songs/song/_mapping' -d '
{
"song" : {
"properties" : {
"position" : {"type" : "integer"}
}
}
}

When i had tried this, i am getting error

{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [position] cannot be changed from type [string] to [int]"}],"type":"illegal_argument_exception","reason":"mapper [position] cannot be changed from type [string] to [int]"},"status":400}

Thanks

Thanigaivelan

You need to reindex the data, you cannot just change it.

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