Dynamic fields and type detection


(Otis Gospodnetić) #1

Hello,

On 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


(Shay Banon) #2

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:
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> wrote:

Hello,

On 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


(system) #3