# String vs other types

**URL:** <https://discuss.elastic.co/t/string-vs-other-types/6642>\
**Category:** Elasticsearch\
**Created:** [February 8, 2012, 6:05pm UTC](https://discuss.elastic.co/t/string-vs-other-types/6642 "2012-02-08T18:05:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chimingc](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@chimingc](https://discuss.elastic.co/u/chimingc)\
**Post date:** [February 8, 2012, 6:05pm UTC](https://discuss.elastic.co/t/string-vs-other-types/6642/1 "2012-02-08T18:05:38Z")

</div>

Hi,

What are the pros and cons of using string type vs other types?

For example, it seems I can index a date using either "string" or "date".  
So what are the differences?  
Any reason I should choose one over another?

Thanks.

---

<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:** [February 8, 2012, 6:11pm UTC](https://discuss.elastic.co/t/string-vs-other-types/6642/2 "2012-02-08T18:11:55Z")

</div>

Using range queries with date fields rocks for example.

You can easily search for a date from 2011 to 2012-02-01 for example.

Using numbers will help to compute facets (mean, min, max, ...)

HTH  
David 😉  
@dadoonet

Le 8 févr. 2012 à 19:05, chimingc [jchen@sugarcrm.com](mailto:jchen@sugarcrm.com) a écrit :

> Hi,
> 
> What are the pros and cons of using string type vs other types?
> 
> For example, it seems I can index a date using either "string" or "date".  
> So what are the differences?  
> Any reason I should choose one over another?
> 
> Thanks.
> 
> --  
> View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/String-vs-other-types-tp3726900p3726900.html](http://elasticsearch-users.115913.n3.nabble.com/String-vs-other-types-tp3726900p3726900.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

---

<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, 3:40am UTC](https://discuss.elastic.co/t/string-vs-other-types/6642/3 "2017-07-06T03:40:06Z")

</div>

Closed on July 6, 2017, 3:40am UTC


