I have the following mappings defined for a field in an index that has hundreds of thousands of documents:
{
"status": {
"type": "text"
}
}
and I want to change its definition to:
{
"status": {
"type": "keyword"
}
}
Is this do-able using the _update_by_query API? What will the performance impact be? If I can run it offline, would it be quicker than the reindexing to v2, dropping the original alias, creating an alias, and then removing the v1 index technique described in the zero-downtime post (https://www.elastic.co/guide/en/elasticsearch/guide/current/index-aliases.html)?
You cannot do this with the update by query API. The _update_by_query API only allows you to reindex a subset of documents, replacing the existing version of the documents (in the same index). The problem is that in order to make the change you want, you'll have to change the mappings, and since this is not an additive change you can only make it on a new index.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.