Elastic search query using ranges


(Jyoti Shukla) #1

I want to find out the number of shifts at 5 A.M in the july month. given the shif-time in date and time format.Example "ShiftTime" : "2017-06-14T06:00:00" and I am also having ShiftDate.

Here what I have tried,

"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"range": {
"date": {
"gte": "2015-06-01",
"lte": "2015-0-30"
}
}
},
{
"script": {
"script": "doc['ShiftTime'].date.hourOfDay == 6 "

      }
    }
  ]
}

}
}

}


(system) #2

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