Kibana watcher ctx.payload.hits.hits is empty even though hits.total is a big number

A part of my watch is below. Why is hits.hits (array) empty when the hits.total is a big number?

      "type": "search",
      "status": "success",
      "payload": {
        "_shards": {
          "total": 1010,
          "failed": 0,
          "successful": 1010,
          "skipped": 1000
        },
        "hits": {
          "hits": [],
          "total": 1128278,
          "max_score": 0

I need to access the source field of the hits.hits.0 and it is coming out to be empty, for sure because hits.hits is itself empty. Why so?

1 Like

I found I had incorrectly set the 'size' of the 'body' to 0. Changed it to a number and it worked.
Thanks!

5 Likes

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