# Dynamic fields and type detection

**URL:** <https://discuss.elastic.co/t/dynamic-fields-and-type-detection/5035>\
**Category:** Elasticsearch\
**Created:** [August 2, 2011, 8:54pm UTC](https://discuss.elastic.co/t/dynamic-fields-and-type-detection/5035 "2011-08-02T20:54:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [August 2, 2011, 8:54pm UTC](https://discuss.elastic.co/t/dynamic-fields-and-type-detection/5035/1 "2011-08-02T20:54:24Z")

</div>

Hello,

On [http://www.elasticsearch.org/guide/reference/mapping/](http://www.elasticsearch.org/guide/reference/mapping/) there is a  
reference to the schemaless nature of ES and its ability to guess  
field types. But how exactly does it guess? Does it try to create  
instances of Java types like Date, Integer, Float, Boolean, String,  
etc.? Or does it use some heuristic based on field names (there is an  
example of "first\_name" at the above URL, for example)?

## Thanks, Otis

Sematext is hiring Search Engineers -- [http://sematext.com/about/jobs.html](http://sematext.com/about/jobs.html)

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [August 2, 2011, 9:08pm UTC](https://discuss.elastic.co/t/dynamic-fields-and-type-detection/5035/2 "2011-08-02T21:08:10Z")

</div>

Json already have numeric types and boolean types, so those are used based  
on it. Date types are automatically detected if the string matches  
predefined (though configurable) date formats (more info here:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html)).

On Tue, Aug 2, 2011 at 11:54 PM, Otis Gospodnetic \<  
[otis.gospodnetic@gmail.com](mailto:otis.gospodnetic@gmail.com)\> wrote:

> Hello,
> 
> On [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/mapping/) there is a  
> reference to the schemaless nature of ES and its ability to guess  
> field types. But how exactly does it guess? Does it try to create  
> instances of Java types like Date, Integer, Float, Boolean, String,  
> etc.? Or does it use some heuristic based on field names (there is an  
> example of "first\_name" at the above URL, for example)?
> 
> ## Thanks, Otis
> 
> Sematext is hiring Search Engineers -- [Jobs - Sematext](http://sematext.com/about/jobs.html)

---

<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:58am UTC](https://discuss.elastic.co/t/dynamic-fields-and-type-detection/5035/3 "2017-07-06T03:58:26Z")

</div>


