# Scoring and aggregation buckets

**URL:** <https://discuss.elastic.co/t/scoring-and-aggregation-buckets/86407>\
**Category:** Elasticsearch\
**Created:** [May 19, 2017, 10:53am UTC](https://discuss.elastic.co/t/scoring-and-aggregation-buckets/86407 "2017-05-19T10:53:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Blackwell](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chris_blackwell/32/4786_2.png) [@Chris\_Blackwell](https://discuss.elastic.co/u/Chris_Blackwell)\
**Post date:** [May 19, 2017, 10:53am UTC](https://discuss.elastic.co/t/scoring-and-aggregation-buckets/86407/1 "2017-05-19T10:53:53Z")

</div>

We'd like to highlight some info from our es dataset for our admins to watch.  
the docs look like this

`{ "timestamp": "2017-05-01 01:01:00", "from": "123", "to": 4566 }`

we want to aggregate on `from` and `to` fields, boosting on the recency of the documents, and also extra weight for longer `from` and `to` values

so an aggregation result with 1000 docs in the last 7 days might be less interesting than one with 500 in the last hour.

I'm not sure where to start with this. Can this be done as a query or do I need to do some pre-aggregation with watcher?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 16, 2017, 10:59am UTC](https://discuss.elastic.co/t/scoring-and-aggregation-buckets/86407/2 "2017-06-16T10:59:54Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
