# Filtering an aggregated result on child documents?

**URL:** https://discuss.elastic.co/t/filtering-an-aggregated-result-on-child-documents/18916
**Category:** Elasticsearch
**Created:** [July 26, 2014, 8:35pm UTC](https://discuss.elastic.co/t/filtering-an-aggregated-result-on-child-documents/18916 "2014-07-26T20:35:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Justin\_Zhu](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@Justin\_Zhu](https://discuss.elastic.co/u/Justin_Zhu)
#### Post date: [July 26, 2014, 8:35pm UTC](https://discuss.elastic.co/t/filtering-an-aggregated-result-on-child-documents/18916/1 "2014-07-26T20:35:25Z")

</div>

We have a parent-\>child mapping of users-\>purchases

The purchase has a 'total' field, that's a dollar amount.

How can we support a query like -- users who's spent over $1000 dollars in  
the past 3 months?

If not currently supported, any suggestions on how it can be done  
efficiently with the current APIs?

Thanks in advance.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8b54d4b6-a2c2-415d-8839-a42c2f1a2601%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8b54d4b6-a2c2-415d-8839-a42c2f1a2601%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:12am UTC](https://discuss.elastic.co/t/filtering-an-aggregated-result-on-child-documents/18916/2 "2017-07-06T01:12:55Z")

</div>


