# Statistical for field with different group

**URL:** <https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677>\
**Category:** Elasticsearch\
**Created:** [July 5, 2013, 11:02am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677 "2013-07-05T11:02:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lijionly](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lijionly](https://discuss.elastic.co/u/lijionly)\
**Post date:** [July 5, 2013, 11:02am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677/1 "2013-07-05T11:02:19Z")

</div>

Hi,  
Is there a way to get statistical for field with different group? For  
instance, I have id and url in the document.  
{  
"ID" : "aa",  
"url" : "[http://51.com/forum-72-1.html](http://51.com/forum-72-1.html)",  
}

then I want to count url for every ID. such as aa has 2 urls and bb has 3  
urls.  
How could I get the statistical from ES?

--  
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:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [July 6, 2013, 5:26am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677/2 "2013-07-06T05:26:02Z")

</div>

Hi,

may be it is just on my side but I really do not understand what you are  
after.  
Do you want to get total count of aa and bb? Or do you can to get count of  
distinct URL values for aa and bb?

Regards,  
Lukas

On Fri, Jul 5, 2013 at 1:02 PM, [lijionly@gmail.com](mailto:lijionly@gmail.com) wrote:

> Hi,  
> Is there a way to get statistical for field with different group? For  
> instance, I have id and url in the document.  
> {  
> "ID" : "aa",  
> "url" : "[http://51.com/forum-72-1.html](http://51.com/forum-72-1.html)",  
> }
> 
> then I want to count url for every ID. such as aa has 2 urls and bb has 3  
> urls.  
> How could I get the statistical from ES?
> 
> --  
> 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).

--  
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:** ![lijionly](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lijionly](https://discuss.elastic.co/u/lijionly)\
**Post date:** [July 8, 2013, 2:01am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677/3 "2013-07-08T02:01:17Z")

</div>

Hi,  
I want to get total count of aa and bb.

在 2013年7月6日星期六UTC+8下午1时26分02秒，Lukáš Vlček写道：

> Hi,
> 
> may be it is just on my side but I really do not understand what you are  
> after.  
> Do you want to get total count of aa and bb? Or do you can to get count of  
> distinct URL values for aa and bb?
> 
> Regards,  
> Lukas
> 
> On Fri, Jul 5, 2013 at 1:02 PM, \<[liji...@gmail.com](mailto:liji...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi,  
> > Is there a way to get statistical for field with different group? For  
> > instance, I have id and url in the document.  
> > {  
> > "ID" : "aa",  
> > "url" : "[http://51.com/forum-72-1.html](http://51.com/forum-72-1.html)",  
> > }
> > 
> > then I want to count url for every ID. such as aa has 2 urls and bb has 3  
> > urls.  
> > How could I get the statistical from ES?
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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:** ![lijionly](https://avatars.discourse-cdn.com/v4/letter/l/839c29/32.png) [@lijionly](https://discuss.elastic.co/u/lijionly)\
**Post date:** [July 11, 2013, 2:16am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677/4 "2013-07-11T02:16:53Z")

</div>

any suggestions?

--  
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:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 11, 2013, 7:07am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677/5 "2013-07-11T07:07:18Z")

</div>

Hey,

usually you can use a simple terms facet for this, but I suppose you are  
having a different document structure. Maybe you can provide a gist, which  
allows every reader to see, what kind of data you are actually trying to  
aggregate, so it is easier to replay your problem

--Alex

On Thu, Jul 11, 2013 at 4:16 AM, [lijionly@gmail.com](mailto:lijionly@gmail.com) wrote:

> any suggestions?
> 
> --  
> 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).

--  
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:27am UTC](https://discuss.elastic.co/t/statistical-for-field-with-different-group/12677/6 "2017-07-06T02:27:01Z")

</div>


