# Group By in Elastic Search

**URL:** <https://discuss.elastic.co/t/group-by-in-elastic-search/6989>\
**Category:** Elasticsearch\
**Created:** [March 14, 2012, 6:34am UTC](https://discuss.elastic.co/t/group-by-in-elastic-search/6989 "2012-03-14T06:34:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)\
**Post date:** [March 14, 2012, 6:34am UTC](https://discuss.elastic.co/t/group-by-in-elastic-search/6989/1 "2012-03-14T06:34:05Z")

</div>

Hi,  
Is there any feature in Elasticsearch to search as GROUP BY In  
SQL? For Example:

## Name Rank

xxxx 1

yyyyy 2

xxxx 1

zzzz 1

Is there any feature in Elasticsearch to search by unique name?

so that the output in should be

## Name Rank

xxxx 1

yyyyy 2

zzzz 1

Cheers!

George

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2012, 6:53am UTC](https://discuss.elastic.co/t/group-by-in-elastic-search/6989/2 "2012-03-14T06:53:43Z")

</div>

Facets could answer to your needs if you want to compute datas.

HTH  
David 😉  
@dadoonet

Le 14 mars 2012 à 07:34, George Viju [vijuitech@gmail.com](mailto:vijuitech@gmail.com) a écrit :

> Hi,  
> Is there any feature in Elasticsearch to search as GROUP BY In  
> SQL? For Example:
> 
> ## Name Rank
> 
> xxxx 1
> 
> yyyyy 2
> 
> xxxx 1
> 
> zzzz 1
> 
> Is there any feature in Elasticsearch to search by unique name?
> 
> so that the output in should be
> 
> ## Name Rank
> 
> xxxx 1
> 
> yyyyy 2
> 
> zzzz 1
> 
> Cheers!
> 
> George

---

<div class="post-metadata">

**Author:** ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)\
**Post date:** [March 14, 2012, 7:09am UTC](https://discuss.elastic.co/t/group-by-in-elastic-search/6989/3 "2012-03-14T07:09:27Z")

</div>

Thanks David.. Will the search response itself gets the unique data  
which is grouped by Name? How can we fetch the data in which the  
response should return the unique data which is grouped by Name?

Cheer!  
George  
On Mar 14, 11:53 am, David Pilato [da...@pilato.fr](mailto:da...@pilato.fr) wrote:

> Facets could answer to your needs if you want to compute datas.
> 
> HTH  
> David 😉  
> @dadoonet
> 
> Le 14 mars 2012 à 07:34, George Viju [vijuit...@gmail.com](mailto:vijuit...@gmail.com) a écrit :
> 
> > Hi,  
> > Is there any feature in Elasticsearch to search as GROUP BY In  
> > SQL? For Example:
> 
> > ## Name Rank
> > 
> > xxxx 1
> 
> > yyyyy 2
> 
> > xxxx 1
> 
> > zzzz 1
> 
> > Is there any feature in Elasticsearch to search by unique name?
> 
> > so that the output in should be
> 
> > ## Name Rank
> > 
> > xxxx 1
> 
> > yyyyy 2
> 
> > zzzz 1
> 
> > Cheers!
> 
> > George

---

<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, 3:36am UTC](https://discuss.elastic.co/t/group-by-in-elastic-search/6989/4 "2017-07-06T03:36:18Z")

</div>


