Skip to content
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

Add a weight for documents in percentiles aggregations #41479

Closed
romainneutron opened this issue Apr 24, 2019 · 5 comments
Closed

Add a weight for documents in percentiles aggregations #41479

romainneutron opened this issue Apr 24, 2019 · 5 comments
Labels

Comments

@romainneutron
Copy link

This is a feature request:

The same way it's possible to compute a weighted average of a doc property using the "Weighted Avg Aggregation", I would like to be able to compute a Weighted Percentile Aggregation.

It seems it's impossible to achieve at the moment without re-implementing the whole percentile algorithm with scripts.

I think it has already been discussed in the past here #8094

@astefan astefan added the :Search Relevance/Ranking Scoring, rescoring, rank evaluation. label Apr 24, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jimczi jimczi added :Analytics/Aggregations Aggregations and removed :Search Relevance/Ranking Scoring, rescoring, rank evaluation. labels Apr 24, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

@jpountz
Copy link
Contributor

jpountz commented Apr 24, 2019

What is your high-level use-case? #8094 mentioned it was about trying to "reduce the number of documents by grouping them". If your use-case is the same then it would be addressed by #33214.

@romainneutron
Copy link
Author

romainneutron commented Apr 25, 2019

My use case is about collecting points with variable sample rate: eg let's collect page load time:

Load Time Sample Rate
200 0.343
250 0.15
230 0.10
5000 0.92

It's easy to convert the sample rate to a weight, it's the direct inverse (1 / sample_rate), so I can use the WeightedAverage to calculate the average load time taking the sample rate into account.
In the same manner, I'd like to compute the percentile aggregation.

@jpountz
Copy link
Contributor

jpountz commented Apr 26, 2019

Thanks for the details. I'm closing in favor of #33214 then, which would give the ability to directly index an histogram of load times into Elasticsearch, which could later be used in the percentiles aggregation.

@jpountz jpountz closed this as completed Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants