Alerts when there are no records in a kibana index

Does anyone know how to generate an alert when there are no records in a Kibana index?

What is the Kibana version that you are using?

Tested with 8.14.1

POST kbn:/api/alerting/rule
{
  "params": {
    "aggType": "count",
    "termSize": 5,
    "thresholdComparator": "<=",
    "timeWindowSize": 5,
    "timeWindowUnit": "m",
    "groupBy": "all",
    "threshold": [
      0
    ],
    "index": [
      "<your index goes here>"
    ],
    "timeField": "@timestamp"
  },
  "consumer": "alerts",
  "schedule": {
    "interval": "1m"
  },
  "tags": [],
  "name": "Index threshold",
  "rule_type_id": ".index-threshold",
  "actions": []
}