How to take last three month date range in ES query irrespective of present month?

Viewed 303
GET index_name/_count
{
  "query": {
    "bool": {
      "must": [
        {
          "range": {
            "time": {
              "gte": "now-3M/M",
              "lte": "now"
            }
          }
        },
        {
          "query_string": {
            "query": "_id:*"
          }
        }
      ]
    }
  }
}

How should we give "gte" specific to 3M/M, getting error as - failed to parse date field [3M/M] with format?

0 Answers
Related