-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calculate ratio between aggregation buckets #16040
Comments
No, it's not possible to do this at the moment, with the current structure of your documents. You can calculate the ratio using a pipeline aggregation as follows:
But you can't sort the terms agg on the result of What you can do though is to create a summarised view on your indexed documents to group them together and index click and view rates within a single document for each campaign. Then what you're after will be easy to do. Have a look at this talk about entity centric indexing for more guidance: https://www.youtube.com/watch?v=yBf7oeJKH2Y |
This is not suitable to data which is ambiguous of how many types it does have util aggregation result show up to us. Just like in this example, if we don't know the exactly action name ("clicks" or "views"), we can't get the aggregation result of the <each_type_count>/<total_count>! |
Hi,
I'm using the following terms aggregations to get views and clicks of each campaign ( by campaign_id ) :
This is the response I get:
Example of a document:
I need to be able to retrieve the conversion rate of each campaign ( clicks / views ) , and I can't do it on the client side since I need to be able to sort by conversion rate. Is it possible on elasticsearch?
Any help would be much appreciated.
The text was updated successfully, but these errors were encountered: