Hi, I've looked all over for how to rename a field and everyone mentions doing a reindex. But isn't a script just as if not more effective (if you don't want to reindex). I just want to make sure I'm not missing something vital here because this seems like a perfectly good solution!
Yes, that will work, however, the field definition will not be removed from your mapping, i.e. you will continue to see oldField in your mapping.
Whereas with reindexing you can keep your mapping clean, i.e. in the new index, oldField will not be present anymore.
Pragmatism is in order here. If you just need to change one field name and/or your index seems to big to reindex, definitely go with update by query. However, if renaming a field is a frequent operation that you're doing, you might want to reindex in order to keep your mapping clean.
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.