lets say that I have index that its mapping look like this:
curl -XPUT 'http://localhost:9200/oldindex/_mapping/book' -d '
{
"book" : {
"properties" : {
"title" : {"type" : "text"},
"words" : {"type" : "text"},
"pages": {"type": "int"}
}
}
}'
I want to create a new index from the old index, but now I want the "words" type field to be "keyword" instead of "text":
curl -XPUT 'http://localhost:9200/oldindex/_mapping/book' -d '
{
"book" : {
"properties" : {
"title" : {"type" : "text"},
"words" : {"type" : "keyword"},
"pages": {"type": "int"}
}
}
}'
How can I do that? can I use "Reindex API" or there is a better solution?