# Question about date mapping and search queries

**URL:** https://discuss.elastic.co/t/question-about-date-mapping-and-search-queries/18063
**Category:** Elasticsearch
**Created:** [June 12, 2014, 10:14am UTC](https://discuss.elastic.co/t/question-about-date-mapping-and-search-queries/18063 "2014-06-12T10:14:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yannis\_rossetto](https://avatars.discourse-cdn.com/v4/letter/y/6de8d8/32.png) [@yannis\_rossetto](https://discuss.elastic.co/u/yannis_rossetto)
#### Post date: [June 12, 2014, 10:14am UTC](https://discuss.elastic.co/t/question-about-date-mapping-and-search-queries/18063/1 "2014-06-12T10:14:37Z")

</div>

Hello,

In our project, we use elaticsearch to index files. For these files, we  
want to store :

1. Text data like title, description, ...
2. Date data

Each document don't have necessary a date, and a document can have multiple  
date data (it depends on user configuration).

I made some test regarding the date data in order to have a concrete  
example and to know how we can build a query with a date parameter (I've  
attached the CURL requests I did) .

I've added a date like "post\_date" = '2014-06-12" (with a string) and I was  
able to search with { "post\_date" : {"gte": "now-1d" } }.

Is it the standard behaviour for date data (add it as string and be able to  
search it with date selector) ?

Thanks a lot,

Yannis ROSSETTO.

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d4225e30-af13-4b63-84e9-79257c6656b1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d4225e30-af13-4b63-84e9-79257c6656b1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:23am UTC](https://discuss.elastic.co/t/question-about-date-mapping-and-search-queries/18063/2 "2017-07-06T01:23:03Z")

</div>


