No hits field at all in search results

I have products index, and when I run a query in Dev Tools like so I see results:

GET /products/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "merchant.id": "1"
          }
        }
      ]
    }
  }
}

Result:

{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 0.2876821,
    "hits": [
      {
        "_index": "products",
        "_id": "1",
        "_score": 0.2876821,
        "_source": {
          "id": 1,
          "status": "available",
          "category": {
            "id": 1,
            "name": {
              "en": "Pizza",
              "ru": "Пицца",
              "uz": "Pitsa"
            }
          }...

But when I run it with my nodejs app I see results with no hits field at all:

const result = await esClient.search({
      index: "products",
      type: '_doc',
      body: {
        query: {
          match_all: {
            "merchant.id": merchantId
          }
        }
      }
    });

and the results here is:

{
  "body": {
    "_index": "products",
    "_id": "_search",
    "_version": 3,
    "result": "updated",
    "_shards": {
      "total": 2,
      "successful": 1,
      "failed": 0
    },
    "_seq_no": 3,
    "_primary_term": 1
  },
  "statusCode": 200,
  "headers": {
    "content-length": "147",
    "content-type": "application/json",
    "x-cloud-request-id": "ko0mcfl9R3yhhD8MlXj2jA",
    "x-elastic-product": "Elasticsearch",
    "x-found-handling-cluster": "85e169669237424cbe3a332acb8082b6",
    "x-found-handling-instance": "instance-0000000000",
    "date": "Sun, 21 Apr 2024 19:00:16 GMT"
  },
  "meta": {
    "context": null,
    "request": {
      "params": {
        "method": "POST",
        "path": "/products/_doc/_search",
        "body": "{\"query\":{\"match_all\":{\"merchant.id\":\"1\"}}}",
        "querystring": "",
        "headers": {
          "user-agent": "elasticsearch-js/7.17.13 (darwin 23.3.0-arm64; Node.js v21.6.1)",
          "x-elastic-client-meta": "es=7.17.13,js=21.6.1,t=7.17.13,hc=21.6.1",
          "content-type": "application/json",
          "content-length": "43"
        },
        "timeout": 30000
      },
      "options": {},
      "id": 4
    },
    "name": "elasticsearch-js",
    "connection": {
      "url": "https://secret.us-east-2.aws.elastic-cloud.com/",
      "id": "https://secret.us-east-2.aws.elastic-cloud.com/",
      "headers": {},
      "deadCount": 0,
      "resurrectTimeout": 0,
      "_openRequests": 0,
      "status": "alive",
      "roles": {
        "master": true,
        "data": true,
        "ingest": true,
        "ml": false
      }
    },
    "attempts": 0,
    "aborted": false
  }
}

where on earth is hits??? when i run this agains docker container on my local i see the results.

Welcome!

You wrote match_all in the second query but match in the first.
But I'm not sure it's the problem here.

Elasticsearch seems to see your request not as a search request but a put document request.
I don't why as I don't see the full code but that might give you a clue.

Thanks for looking at this issue, I found a solution, on my local, I have been using es v7, but I got v8 on staging, sdk on nodejs was v7 too, so I migrated my local es to v8 and updated nodejs library to v8.