String to nested type, possible?

Hi,

I have an existing index where the field items looks like:

"items": "{"productA":{"qty":3},"productB":{"qty":5},"productC":{"qty":9}}"

The field items is mapped as type text. The field items can contain any number of products (productA, productB etc.).

Is it possible to use a pipeline processor or transform job or similar to convert the string items to a nested datatype so that I can perform aggregations on it?

The nested field should look something like:

  "items": [
    {
      "product": "A",
      "qty": 3
    },
    {
      "product": "B",
      "qty": 5
    },
    { "product": "C",
      "qty": 9
    }
  ]

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