Hi,
I need to add a new field to all the docs present in the index. Is there a way to accomplish this ?
Hi,
I need to add a new field to all the docs present in the index. Is there a way to accomplish this ?
Hi,
if all you have to do is to add a new field, you can accomplish it with an update_by_query
(see documentation) and a simple script. Something like
POST your_index/_update_by_query
{
"script": {
"source": "ctx._source.new_field = null"
}
}
Of course, feel free to choose any other null value.
yes it worked .....
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.