Hi, I created a new field for my indices and running an update_by_query where I'm basically populating that field by aggrigating values from other fields:
{
"script": {
"source":
"ctx._source.all_names = [];
ctx._source.all_names.add(ctx._source.name);
if (ctx._source.previous_names_nested != null) {
for (int i=0; i<ctx._source.previous_names_nested.length; i++) {
ctx._source.all_names.add(ctx._source.previous_names_nested[i].company_name)
}
}
if (ctx._source.other_names != null) {ctx._source.all_names.addAll(ctx._source.other_names)}"
}
}
While this seems to work, for some reason it's taking WAY more space than expected. Most of the time "previous_names_nested" and "other_names" are null, so only the "name" gets copied. Yet, as I'm running the query and monitoring the disk space, I can see that I will run out of disk space by the time it's finished. Am I doing something wrong here?