Convert strings to floats/ints at aggregation time?

(amol.deshpande) #1


Is there any way to convert strings to floats (and ints) when specifying a
terms or histogram aggregation ? I have documents with fields that are
floats and ints but are not parsed by elasticsearch as such.

I know I could change the mapping, but for the usage case that I have
(support extraction of arbitrary events from log files, just by specifying
fields to index with simple regexes), it would be a lot more handy if I
could specify something like "script : _value.tofloat()" when writing the
aggregation for the field.


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
To view this discussion on the web visit
For more options, visit

(system) #2