# Query strategy for stateful event timeseries

**URL:** https://discuss.elastic.co/t/query-strategy-for-stateful-event-timeseries/35602
**Category:** Elasticsearch
**Created:** [November 25, 2015, 7:54pm UTC](https://discuss.elastic.co/t/query-strategy-for-stateful-event-timeseries/35602 "2015-11-25T19:54:01Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [November 26, 2015, 8:09am UTC](https://discuss.elastic.co/t/query-strategy-for-stateful-event-timeseries/35602/2 "2015-11-26T08:09:35Z")

</div>

As I described in [this recent post](https://discuss.elastic.co/t/bucket-selector-aggregation-script-access-doc-index-field-value/35516), you might be able to achieve this by creating a separate wedges-centric index and index your data twice. In your current index you store all the individual state changes while you in the widget-centric index store only the current state of each widget, where each change results in an update.

---

_[View the full topic](https://discuss.elastic.co/t/query-strategy-for-stateful-event-timeseries/35602)._
