# Querying by a datetime field using ElasticSearch Head?

**URL:** <https://discuss.elastic.co/t/querying-by-a-datetime-field-using-elasticsearch-head/11916>\
**Category:** Elasticsearch\
**Created:** [May 10, 2013, 9:04pm UTC](https://discuss.elastic.co/t/querying-by-a-datetime-field-using-elasticsearch-head/11916 "2013-05-10T21:04:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ralph\_Trickey\_2](https://avatars.discourse-cdn.com/v4/letter/r/f19dbf/32.png) [@Ralph\_Trickey\_2](https://discuss.elastic.co/u/Ralph_Trickey_2)\
**Post date:** [May 10, 2013, 9:04pm UTC](https://discuss.elastic.co/t/querying-by-a-datetime-field-using-elasticsearch-head/11916/1 "2013-05-10T21:04:56Z")

</div>

It seems like there should be a simple solution, but I've looked all over  
and can't find an answer.

This is using elasticsearch head.

I see some results in the browser.

I select the contents of the timestamp field.

I then run the following query and it returns nothing.

What am I missing???

Thanks,  
Ralph

{"query":{"bool":{"must":[{"term":{"webservicebolcalls.Timestamp":"1/16/2013  
12:04:28  
PM"}}],"must\_not":[],"should":[]}},"from":0,"size":50,"sort":[],"facets":{}}

Timestamp: 1/16/2013 12:04:28 PM  
Milliseconds: 341  
MessageId: f6d9648e-bc13-4f51-9f51-8eed6f673210  
Endpoint: Internal

- 
- 

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 11, 2013, 2:15am UTC](https://discuss.elastic.co/t/querying-by-a-datetime-field-using-elasticsearch-head/11916/2 "2013-05-11T02:15:37Z")

</div>

You are using a TermQuery which is not analyzed.  
Depending on your mapping, your field can have been indexed as a String or as a date (ms since epoch).

1st: check your mapping  
2nd: Try to use matchQuery or RangeQuery.

## HTH

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 10 mai 2013 à 23:04, Ralph Trickey [ralphtrickey@gmail.com](mailto:ralphtrickey@gmail.com) a écrit :

It seems like there should be a simple solution, but I've looked all over and can't find an answer.

This is using elasticsearch head.

I see some results in the browser.

I select the contents of the timestamp field.

I then run the following query and it returns nothing.

What am I missing???

Thanks,  
Ralph

{"query":{"bool":{"must":[{"term":{"webservicebolcalls.Timestamp":"1/16/2013 12:04:28 PM"}}],"must\_not":[],"should":[]}},"from":0,"size":50,"sort":[],"facets":{}}

Timestamp: 1/16/2013 12:04:28 PM  
Milliseconds: 341  
MessageId: f6d9648e-bc13-4f51-9f51-8eed6f673210  
Endpoint: Internal

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:37am UTC](https://discuss.elastic.co/t/querying-by-a-datetime-field-using-elasticsearch-head/11916/3 "2017-07-06T02:37:06Z")

</div>


