title: elastic search and date range filters
body: <p>I'm trying to filter an elastic search query by date using the <a href="https://github.com/humangeo/rawes" rel="nofollow">rawes</a> python bindings. If I drop the database, specify that the <code>datetime</code> field is a <a href="http://www.elasticsearch.org/guide/reference/mapping/date-format.html" rel="nofollow">date_optional_time</a>, insert a few rows into the elastic search database, and then query it using a <a href="http://www.elasticsearch.org/guide/reference/query-dsl/range-query.html" rel="nofollow">range filter</a> on the <code>datetime</code> field, I get no results (see below). Any idea what I am doing wrong?</p>
  
  <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; result = es.delete(root_url)
  &gt;&gt;&gt; result = es.put(root_url+"_mapping", data={
      "tweet": {
          "properties": {
              "datetime": {
                  "type": "date", 
                  "format": "date_optional_time"
              },
          }
      },
  })
  &gt;&gt;&gt; result = es.post(root_url, data={
      "datetime": "2012-12-20 12:00:00",
      "name": "freddy",
      "text": "hello world",
  })
  &gt;&gt;&gt; result = es.post(root_url, data={
      "datetime": "2012-11-20 12:00:00",
      "name": "julie",
      "text": "welcome to the wonderful world of cooking",
  })
  &gt;&gt;&gt; result = es.get(root_url+"_search", data={
      "query": {
          "range": {  # expect this to return the one result on 2012-12-20
              "datetime": {
                  "gte":"2012-12-01", # do not append "T00:00:00"; too slow!
                  "lte":"2012-12-31", # do not append "T23:59:59"; too slow! 
              }
          }
      }
  })
  &gt;&gt;&gt; pprint.pprint(result)
  {u'_shards': {u'failed': 0, u'successful': 5, u'total': 5},
   u'hits': {u'hits': [], u'max_score': None, u'total': 0},
   u'timed_out': False,
   u'took': 4}
  </code></pre>