How to delete a expecif field in a query elasticsearch

If i have that document:

 POST /contentman/sites
{
  "name":"jimmy_page",
  "author":"Jimmy Page",
  "instalacao":"MD",
  "raiz":"jimmy_oage",
  "url":"jimmy_oage",
  "PAGES":[
    {
      "name":"index",
      "site_id":"1",
      "AREAS":[
        {
          "name":"inicio",
          "page_id":"1"
        }
        ]
    },
    {
      "name":"another_index",
      "site_id":"2",
      "AREAS":[
        {
          "name":"inicio",
          "page_id":"1"
        }
        ]
    }
    ]
}

And I only want to delete the PAGE in that has the name equals to Index, what Query should I do to delete that Page?

May be an update by query with a painless script but that looks super complicated to me.
Can't you just find all the documents which are matching PAGE.name=index and then process them individually to remove whatever content you want and index again the modified document?

I believe this is doable with a Painless script but I can't help more as I'm not a painless user. :slight_smile:

1 Like

haha, i'll check that approach, i'll go for the painless solution :smiley:

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