I would like to graph a ratio between two counts on the same index.
For example, if we take the books dataset, count the ratio of American book out of all the expensive books (more than 10$)
count(books where country=US and price > 10$) / count ( books where price > 10$)
I want to be able to graph the evolution of this ratio aggregated per day of publication or any kind of bucketing (per country, per geohash, ...).
Do you have any idea on how to do that ? Considering that I can afford changing the data structure.
Yes indeed, it seems to be related to this limitation.
Btw, Timelion plugin for Kibana was just released, which makes doing ratios in Elasticsearch of two series trivial: https://www.elastic.co/blog/timelion-timeline
Thank you Tanya for pointing out Timelion.
It seems very promising.
Is TimeLion able to calculate a CTR , ie count(occurrence of text field A) / count(occurrence of text field B) * 100?
The video https://www.elastic.co/videos/time-series-analysis-using-timelion shows something the creator made but it doesn't describe the syntax of the query language and its vocabulary.
Documentation seems very sparse for timelion. But you should be able to do that.
With TimeLion we have the ratio over the Time, is it possible to have the ratio per term of a field?