Index action - document construction

I tried to use watcher in this way:

  1. initial payload is search request with some aggregations

  2. as a watcher action I wanted to index aggregation buckets in way "1
    bucket from search response results in 1 new indexed document"

but I got in trouble with mentioned "data": {"_value": structure... - which doesn't fit required mapping, I need unwrap this "data" field wrapper.
Is possible to create transform script which leads to required behavior - multiple new indexed documents?