# Grouping search response

**URL:** <https://discuss.elastic.co/t/grouping-search-response/7659>\
**Category:** Elasticsearch\
**Created:** [May 11, 2012, 11:39am UTC](https://discuss.elastic.co/t/grouping-search-response/7659 "2012-05-11T11:39:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nmz/32/2842_2.png) [@nmz](https://discuss.elastic.co/u/nmz)\
**Post date:** [May 11, 2012, 11:39am UTC](https://discuss.elastic.co/t/grouping-search-response/7659/1 "2012-05-11T11:39:56Z")

</div>

Is it possible to get the response as a group based on some id[id - is  
a field of my document], I dont need to do a group by, but in the  
search response I need the documents having the same field value for  
'id' to be returned together.

Can facets help in this?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [May 13, 2012, 12:11pm UTC](https://discuss.elastic.co/t/grouping-search-response/7659/2 "2012-05-13T12:11:53Z")

</div>

No, there isn't support for that, at least yet, in elasticsearch.

On Fri, May 11, 2012 at 2:39 PM, nmz [s.namitha.s@gmail.com](mailto:s.namitha.s@gmail.com) wrote:

> Is it possible to get the response as a group based on some id[id - is  
> a field of my document], I dont need to do a group by, but in the  
> search response I need the documents having the same field value for  
> 'id' to be returned together.
> 
> Can facets help in this?

---

<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:29am UTC](https://discuss.elastic.co/t/grouping-search-response/7659/3 "2017-07-06T03:29:03Z")

</div>


