Skip to content

Commit

Permalink
Fix renaming properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ElliottKasoar committed Apr 29, 2024
1 parent 14faef3 commit ceb0aaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions abcd/backends/atoms_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,10 @@ def rename_property(
query = self.parser(query)
logger.info("rename: query=%s, old=%s, new=%s", query, name, new_name)

script_txt = f"if (!ctx._source.containsKey('{new_name}')) {{ "
script_txt = f"if (!ctx._source.containsKey(params.new_name)) {{ "
script_txt += (
f"ctx._source.{new_name} = ctx._source.{name};"
" ctx._source.remove('params.name');"
" ctx._source.remove(params.name);"
" for (int i=0; i<ctx._source.derived.info_keys.length; i++) {"
" if (ctx._source.derived.info_keys[i] == params.name) { "
" ctx._source.derived.info_keys[i] = params.new_name;}}}"
Expand Down

0 comments on commit ceb0aaf

Please sign in to comment.