# Finding Trending Documents

**URL:** <https://discuss.elastic.co/t/finding-trending-documents/38755>\
**Category:** Elasticsearch\
**Created:** [January 8, 2016, 7:59pm UTC](https://discuss.elastic.co/t/finding-trending-documents/38755 "2016-01-08T19:59:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![swrecked](https://avatars.discourse-cdn.com/v4/letter/s/c0e974/32.png) [@swrecked](https://discuss.elastic.co/u/swrecked)\
**Post date:** [January 8, 2016, 7:59pm UTC](https://discuss.elastic.co/t/finding-trending-documents/38755/1 "2016-01-08T19:59:55Z")

</div>

I have events I would like to store in an es index that look like:

{  
document\_id: 1,  
event: 'view',  
view\_at: 2016-01-08T19:46:50Z  
}

Is there a way to use the decay functions in es to find trending documents over the past n hours (e.g. trending over the last day). The examples on decay functions all use a 'total' field, but I"m looking to store single events as they happen and then use es to figure out trending based on this event stream.

---

<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:** [July 5, 2017, 11:25pm UTC](https://discuss.elastic.co/t/finding-trending-documents/38755/2 "2017-07-05T23:25:52Z")

</div>


