Prometheus metric retruns no data

i have installed the prometheus-es-exporter for querying the elasticsearch and also i have written some queries.E.g one of the query looks like:

QueryIntervalSecs = 300
QueryIndices = logs.*
QueryJson = {
  "size": 0,
  "query": {
    "query_string": {
      "query": "message: \" \" AND @timestamp:(>=now-1h AND <now)"
  "aggs": {
    "application": {
      "terms": {
        "field": ""

ES-Exporter exposes after the configuration the metric database_connection_exception_application_doc_count but i face the issue that sometimes i get in prometheus the error message:

This happens not only for this query but for other queries as well.My understanding and expectation is that if my query does not find the string for the last 1h it must return the value=0 in prometheus but for some reason it returns no data.How should i understand this? ES-Exporter is running smoothly,health check of ES-Exporter and Elastic shows no error,all elastic nodes are at state green.