I'm trying to do aggregation using java api. But couldn't get the SearchResponse correctly. Getting below error. I've written method like
below using XContentBuilder.
Couldn't get any working scenarios from google. Please suggest any working
example for aggregation of single value.
public static Aggregations searchAggregation() throws IOException {*
On Fri, May 23, 2014 at 7:30 PM, Subhadip Bagui i.bagui@gmail.com wrote:
Hi,
I'm trying to do aggregation using java api. But couldn't get the SearchResponse correctly. Getting below error. I've written method like
below using XContentBuilder.
Couldn't get any working scenarios from google. Please suggest any working
example for aggregation of single value.
public static Aggregations searchAggregation() throws IOException {*
Thank you Adrien, I'm getting the aggregation value now.
One doubt here. I have a field which stores values likes "CPU_USED" :
"0.04%"
Want to do aggregation on that. Can I do any string manipulation here on
the field passed on AggregationBuilders ? Tried like this but not working .
Please suggest.
addAggregation(AggregationBuilders.avg("cpu_used_avg").script("doc['CPU_USED'].value".replace("%",
"")))
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.