How to copy from one nested field to another in elasticsearch?

Hi all,

I'm trying to copy from one field to another.

I want to copy data from fanLocation.lng to fanLocation.lon in an index.
I have already mapped both geo fields with geo_point
i'm unable to use when using nested fields:

POST myindex/_update_by_query
{
   "script" : {
      "inline": "ctx._source.fanLocation.lon = ctx._source.fanLocation.lng", 
      "lang"   : "painless"
   },
  "query": {
        "bool": {
            "must": [
                {
                    "match": {
                       "continent.keyword": "Europe"
                    }
                },
            ]
        }
    }
  }

I'm unable to do so.
What is the correct format for nested fields?

Can you share a fully reproducible example including index and document creation? Thank you!

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