Round the values returned by facets

Is it possible to perform a query which returns floating values
rounded by x places after the points?

It's possible to modify the value of the fields you are calculating facets
on using term scripts
(Elasticsearch Platform — Find real-time answers at scale | Elastic)

For example, the following query will return facets with floating values in
the my_field field rounded by 2 decimal places.

{
"size" : 0,
"query" : { "query_string" : {"query" : ":"} },
"facets" : {
"from" : {
"terms" : {
"field" : "my_field",
"script": "round(term*100)/100"
}
}
}
}

Igor Motov

On Monday, March 12, 2012 9:48:23 AM UTC-4, Yehuda Zargarov wrote:

Is it possible to perform a query which returns floating values
rounded by x places after the points?