Datetime hour search query

Hello,

I'm just starting to use Elastic and having trouble parsing datetime data. In Python, I'm trying to create a query that puts out all documents for which the hour value in the field 'datetime' equals 11. Been trying to go along many routes, but so far no luck.

My mapping is as follows:

settings = {
   'settings': {
        "number_of_shards" : 1
   },
   'mappings': {
    'properties': {
        'datetime': {'type': 'date', "format": "yyyy-MM-dd HH:mm:ss" },
    }
  }
}

Hope you guys can help me out. Thank you.

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