Field type change from long to string


(kalpana pinnaka) #1

Hi

curl -X PUT "localhost:9200/suggestions/suggest/_mapping" -d '{
"suggest" : {
"properties" : {
"key" : {
"type" : "long"
}
}
}
}'

created mapping like above.
i want to change key field data type "long" to "string"
right now i am creating the mapping again with type:"string"
without recreation of mapping how can i change type "long" to
"string"

Thanks in advance


(Shay Banon) #2

You can't change the type of a field once it has been set, since it
controls how its indexed.

On Tue, Nov 22, 2011 at 3:12 PM, kalpana pinnaka saikalpana18@gmail.comwrote:

Hi

curl -X PUT "localhost:9200/suggestions/suggest/_mapping" -d '{
"suggest" : {
"properties" : {
"key" : {
"type" : "long"
}
}
}
}'

created mapping like above.
i want to change key field data type "long" to "string"
right now i am creating the mapping again with type:"string"
without recreation of mapping how can i change type "long" to
"string"

Thanks in advance


(system) #3