# Difficulty trying to find a way to use facets

**URL:** https://discuss.elastic.co/t/difficulty-trying-to-find-a-way-to-use-facets/11457
**Category:** Elasticsearch
**Created:** [April 4, 2013, 10:22pm UTC](https://discuss.elastic.co/t/difficulty-trying-to-find-a-way-to-use-facets/11457 "2013-04-04T22:22:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shadyabhi](https://avatars.discourse-cdn.com/v4/letter/s/edb3f5/32.png) [@shadyabhi](https://discuss.elastic.co/u/shadyabhi)
#### Post date: [April 4, 2013, 10:22pm UTC](https://discuss.elastic.co/t/difficulty-trying-to-find-a-way-to-use-facets/11457/1 "2013-04-04T22:22:43Z")

</div>

Hi all,

First of all, I posted via email but somehow I can't see it in  
[groups.google.com](http://groups.google.com) so posting via web-ui.

I'm using ES to store maillogs. In that, I'm trying to use ES to generate  
statistics for ex, per domain bandwidth usage etc.

For ex, if I have a document which has fields like:

- @fields.from: [abc@domain.com](mailto:abc@domain.com)
- @fields.size: 1024

Now, there can be many email addresses like [abc@domain.com](mailto:abc@domain.com). I just want the  
summation of size for a particular domain. How do I accomplish that?

I had a look at statistical facet and scripts but I'm not sure how will I  
use it to do per domain summation of @fields.size field. Ultimately, I want  
something like: [domain.com](http://domain.com) did x size of mails.

Any help is highly appreciated. Thanks

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:42am UTC](https://discuss.elastic.co/t/difficulty-trying-to-find-a-way-to-use-facets/11457/2 "2017-07-06T02:42:42Z")

</div>


