# Collapse field

**URL:** <https://discuss.elastic.co/t/collapse-field/3922>\
**Category:** Elasticsearch\
**Created:** [February 14, 2011, 4:29am UTC](https://discuss.elastic.co/t/collapse-field/3922 "2011-02-14T04:29:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NANA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nana/32/3268_2.png) [@NANA](https://discuss.elastic.co/u/NANA)\
**Post date:** [February 14, 2011, 4:29am UTC](https://discuss.elastic.co/t/collapse-field/3922/1 "2011-02-14T04:29:21Z")

</div>

hello  
I find the discussion  
[http://groups.google.com/a/elasticsearch.com/group/users/browse\_thread/thread/fc74f7cf7977bd15/11c4b9cb355e9e0e?lnk=gst&q=collapse#11c4b9cb355e9e0e](http://groups.google.com/a/elasticsearch.com/group/users/browse_thread/thread/fc74f7cf7977bd15/11c4b9cb355e9e0e?lnk=gst&q=collapse#11c4b9cb355e9e0e)  
but i need to know is the feature is implemented or...is there is any  
way to get the total search values so that i can collapse it  
manually...

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [February 14, 2011, 6:40pm UTC](https://discuss.elastic.co/t/collapse-field/3922/2 "2011-02-14T18:40:58Z")

</div>

it's not implemented:

> **[Issues · elastic/elasticsearch](https://github.com/elastic/elasticsearch/issues#issue/256)**
>
> Free and Open, Distributed, RESTful Search Engine. Contribute to elastic/elasticsearch development by creating an account on GitHub.

but you can do it on the client side with a size of 200 or, say 500

increasing the size to get all results is not recommended!

Regards,  
Peter.

On 14 Feb., 05:29, NANA [naveen....@gmail.com](mailto:naveen....@gmail.com) wrote:

> hello  
> I find the discussionhttp://groups.google.com/a/elasticsearch.com/group/users/browse\_threa...  
> but i need to know is the feature is implemented or...is there is any  
> way to get the total search values so that i can collapse it  
> manually...

---

<div class="post-metadata">

**Author:** ![NANA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nana/32/3268_2.png) [@NANA](https://discuss.elastic.co/u/NANA)\
**Post date:** [February 14, 2011, 6:54pm UTC](https://discuss.elastic.co/t/collapse-field/3922/3 "2011-02-14T18:54:22Z")

</div>

You are correct we can do it exactly in client side but my case is this ..

1)i have an local web search with 10 million document and the thing is i  
need to collapse and give an single search result per domain name say if we  
have an 10,000 doc for search result \*web design \*if we get some 1000 or 200  
document and collapse may be the first 1000 will be from same domain so it  
may go wrong....

1. is there is any way to get the total no of results in ES for an search  
term....

On Tue, Feb 15, 2011 at 12:10 AM, Karussell [tableyourtime@googlemail.com](mailto:tableyourtime@googlemail.com)wrote:

> it's not implemented:
> 
> [Issues · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/#issue/256)
> 
> but you can do it on the client side with a size of 200 or, say 500
> 
> increasing the size to get all results is not recommended!
> 
> Regards,  
> Peter.
> 
> On 14 Feb., 05:29, NANA [naveen....@gmail.com](mailto:naveen....@gmail.com) wrote:
> 
> > hello  
> > I find the discussionhttp://  
> > [groups.google.com/a/elasticsearch.com/group/users/browse\_threa](http://groups.google.com/a/elasticsearch.com/group/users/browse_threa)...  
> > but i need to know is the feature is implemented or...is there is any  
> > way to get the total search values so that i can collapse it  
> > manually...

--  
with Thanks & Regards ,  
Naveen.A.N  
[http://www.zeeroos.com](http://www.zeeroos.com)  
_P_\* \*_Please don't print this e-mail unless you really need to. Save the  
environment_

---

<div class="post-metadata">

**Author:** ![Karussell1](https://avatars.discourse-cdn.com/v4/letter/k/50afbb/32.png) [@Karussell1](https://discuss.elastic.co/u/Karussell1)\
**Post date:** [February 15, 2011, 2:41pm UTC](https://discuss.elastic.co/t/collapse-field/3922/4 "2011-02-15T14:41:07Z")

</div>

> may be the first 1000 will be from same domain

then you should probably create one doc per domain or create an  
additional index with one doc per domain (use highlighting to get the  
actual snippet) ?

or another (bad) workaround could be to use term facets (faceting on  
the domain name ...) and use that info to nest deeper

> 1.

do you mean SearcHits.totalHits?

On 14 Feb., 19:54, "Naveen.A.N" [naveen....@gmail.com](mailto:naveen....@gmail.com) wrote:

> You are correct we can do it exactly in client side but my case is this ..
> 
> 1)i have an local web search with 10 million document and the thing is i  
> need to collapse and give an single search result per domain name say if we  
> have an 10,000 doc for search result \*web design \*if we get some 1000 or 200  
> document and collapse may be the first 1000 will be from same domain so it  
> may go wrong....
> 
> 1. is there is any way to get the total no of results in ES for an search  
> term....
> 
> On Tue, Feb 15, 2011 at 12:10 AM, Karussell [tableyourt...@googlemail.com](mailto:tableyourt...@googlemail.com)wrote:
> 
> > it's not implemented:
> 
> > [Issues · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/#issue/256)
> 
> > but you can do it on the client side with a size of 200 or, say 500
> 
> > increasing the size to get all results is not recommended!
> 
> > Regards,  
> > Peter.
> 
> > On 14 Feb., 05:29, NANA [naveen....@gmail.com](mailto:naveen....@gmail.com) wrote:
> > 
> > > hello  
> > > I find the discussionhttp://  
> > > [groups.google.com/a/elasticsearch.com/group/users/browse\_threa](http://groups.google.com/a/elasticsearch.com/group/users/browse_threa)...  
> > > but i need to know is the feature is implemented or...is there is any  
> > > way to get the total search values so that i can collapse it  
> > > manually...
> 
> --  
> with Thanks & Regards ,  
> Naveen.A.Nhttp://www.zeeroos.com  
> _P_\* \*_Please don't print this e-mail unless you really need to. Save the  
> environment_

---

<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, 4:12am UTC](https://discuss.elastic.co/t/collapse-field/3922/5 "2017-07-06T04:12:04Z")

</div>


