Finding percentage difference/deviation using 2 queries


(Suriya) #1

Hi,

So what I am trying to do is find the percent difference over time. For this, I take the average values over the past hour and compare them to the average values over the past day. I can do this using 2 queries and it works, but it would be more efficient to have elastic search itself return the percent differences than having me query twice and do the calculations in my Java code.

Thanks in advance!


(Mark Walkom) #2

This will be possible with ES 2.0 and pipeline aggs, at the moment you need to do 2 queries.


(Suriya) #3

Are pipeline aggs currently implemented in the master version so I could try using them now?
Thanks!


(Suriya) #4

When working with the master trying to test out piped aggregations, I received this error in trying to create my TransportClient. Any idea what it is about?

Exception in thread "main" java.lang.IllegalStateException: path.home is not configured
at org.elasticsearch.env.Environment.(Environment.java:89)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:87)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:60)
at org.elasticsearch.client.transport.TransportClient$Builder.build(TransportClient.java:114)
at com.viptela.test.testcases.elasticsearch.ESTest.main(ESTest.java:46)


(system) #5