Reindex to change the name of multiple fields

Hi,

As title says, is it possible to Reindex to change the name of multiple fields?
Instruction shown here is only for single field.

Thanks!

Sure, you the script can be multiple lines.

Can you show me a simple example?
I tried to nest script field but it gives me a syntax error

Just the script portion:

"script": {
  "inline": "ctx._source['newfield1'] = ctx._source.remove('oldfield1'); ctx._source['newfield2'] = ctx._source.remove('oldfield2');"
}
3 Likes

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.