# Can i filter Facets by count\>1

**URL:** <https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610>\
**Category:** Elasticsearch\
**Created:** [June 13, 2011, 3:58am UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610 "2011-06-13T03:58:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 13, 2011, 3:58am UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/1 "2011-06-13T03:58:58Z")

</div>

I need to return facet terms whose count\>1, how could i achieve it?

Currently I can retrieve all the facets and filter out those whose  
frequency=1, is there any better approach?

---

<div class="post-metadata">

**Author:** ![Cedric\_EXBRAYAT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cedric_exbrayat/32/3193_2.png) [@Cedric\_EXBRAYAT](https://discuss.elastic.co/u/Cedric_EXBRAYAT)\
**Post date:** [June 23, 2011, 7:41am UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/2 "2011-06-23T07:41:11Z")

</div>

I've got a similar problem.

In SolR, there is something like minCount on facets  
[http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount](http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount)

Am I missing something in elasticsearch to do that ?

On 13 juin, 05:58, Weiwei Wang [ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) wrote:

> I need to returnfacetterms whosecount\>1, how could i achieve it?
> 
> Currently I can retrieve all the facets and filter out those whose  
> frequency=1, is there any better approach?

---

<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:** [June 23, 2011, 11:56am UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/3 "2011-06-23T11:56:22Z")

</div>

Which facet are you referring to, the terms one?

On Thursday, June 23, 2011 at 10:41 AM, Cedric wrote:

> I've got a similar problem.
> 
> In SolR, there is something like minCount on facets  
> [http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount](http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount)
> 
> Am I missing something in elasticsearch to do that ?
> 
> On 13 juin, 05:58, Weiwei Wang \<[ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) ([http://gmail.com](http://gmail.com))\> wrote:
> 
> > I need to returnfacetterms whosecount\>1, how could i achieve it?
> > 
> > Currently I can retrieve all the facets and filter out those whose  
> > frequency=1, is there any better approach?

---

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 23, 2011, 12:22pm UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/4 "2011-06-23T12:22:36Z")

</div>

hi, shay,  
i'm using TermsFacet to find the duplicate documents based on  
certain field.

I have another question is that, i want to know the count of each term  
and the ids associated with this term, the current version of ES  
support this kind of operation?

On Jun 23, 7:56 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:

> Which facet are you referring to, the terms one?
> 
> On Thursday, June 23, 2011 at 10:41 AM, Cedric wrote:
> 
> > I've got a similar problem.
> 
> > In SolR, there is something like minCount on facets  
> > [http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount](http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount)
> 
> > Am I missing something in elasticsearch to do that ?
> 
> > On 13 juin, 05:58, Weiwei Wang \<[ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) ([http://gmail.com](http://gmail.com))\> wrote:
> > 
> > > I need to returnfacetterms whosecount\>1, how could i achieve it?
> 
> > > Currently I can retrieve all the facets and filter out those whose  
> > > frequency=1, is there any better approach?

---

<div class="post-metadata">

**Author:** ![Cedric\_EXBRAYAT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cedric_exbrayat/32/3193_2.png) [@Cedric\_EXBRAYAT](https://discuss.elastic.co/u/Cedric_EXBRAYAT)\
**Post date:** [June 23, 2011, 1:32pm UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/5 "2011-06-23T13:32:06Z")

</div>

In my case, it's a date histogram (but it can be any facet), and we'd like  
to return only the facets with a minimum number of documents.  
(for example : return the users with at least 5 tweets during a week).

The 'at least 5' part is the problem : we can filter manually but I was  
wondering if something can do the job in ES (as it can be done in SolR with  
a minCount).

On Thu, Jun 23, 2011 at 2:22 PM, Weiwei Wang [ww.wang.cs@gmail.com](mailto:ww.wang.cs@gmail.com) wrote:

> hi, shay,  
> i'm using TermsFacet to find the duplicate documents based on  
> certain field.
> 
> I have another question is that, i want to know the count of each term  
> and the ids associated with this term, the current version of ES  
> support this kind of operation?
> 
> On Jun 23, 7:56 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> 
> > Which facet are you referring to, the terms one?
> > 
> > On Thursday, June 23, 2011 at 10:41 AM, Cedric wrote:
> > 
> > > I've got a similar problem.
> > 
> > > In SolR, there is something like minCount on facets  
> > > [http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount](http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount)
> > 
> > > Am I missing something in elasticsearch to do that ?
> > 
> > > On 13 juin, 05:58, Weiwei Wang \<[ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) ([http://gmail.com](http://gmail.com))\>  
> > > wrote:
> > > 
> > > > I need to returnfacetterms whosecount\>1, how could i achieve it?
> > 
> > > > Currently I can retrieve all the facets and filter out those whose  
> > > > frequency=1, is there any better approach?

---

<div class="post-metadata">

**Author:** ![Cedric\_EXBRAYAT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cedric_exbrayat/32/3193_2.png) [@Cedric\_EXBRAYAT](https://discuss.elastic.co/u/Cedric_EXBRAYAT)\
**Post date:** [June 27, 2011, 8:13am UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/6 "2011-06-27T08:13:48Z")

</div>

Shoul I open a proposal for a new feature on github or am I missing  
something ?

(Be able to filter facets with a minimum number of documents to request for  
example 'the users with at least 5 tweets during a week')

On Thu, Jun 23, 2011 at 3:32 PM, Cédric EXBRAYAT [cexbrayat@gmail.com](mailto:cexbrayat@gmail.com)wrote:

> In my case, it's a date histogram (but it can be any facet), and we'd like  
> to return only the facets with a minimum number of documents.  
> (for example : return the users with at least 5 tweets during a week).
> 
> The 'at least 5' part is the problem : we can filter manually but I was  
> wondering if something can do the job in ES (as it can be done in SolR with  
> a minCount).
> 
> On Thu, Jun 23, 2011 at 2:22 PM, Weiwei Wang [ww.wang.cs@gmail.com](mailto:ww.wang.cs@gmail.com) wrote:
> 
> > hi, shay,  
> > i'm using TermsFacet to find the duplicate documents based on  
> > certain field.
> > 
> > I have another question is that, i want to know the count of each term  
> > and the ids associated with this term, the current version of ES  
> > support this kind of operation?
> > 
> > On Jun 23, 7:56 pm, Shay Banon [shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) wrote:
> > 
> > > Which facet are you referring to, the terms one?
> > > 
> > > On Thursday, June 23, 2011 at 10:41 AM, Cedric wrote:
> > > 
> > > > I've got a similar problem.
> > > 
> > > > In SolR, there is something like minCount on facets  
> > > > [http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount](http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount)
> > > 
> > > > Am I missing something in elasticsearch to do that ?
> > > 
> > > > On 13 juin, 05:58, Weiwei Wang \<[ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) (  
> > > > [http://gmail.com](http://gmail.com))\> wrote:
> > > > 
> > > > > I need to returnfacetterms whosecount\>1, how could i achieve it?
> > > 
> > > > > Currently I can retrieve all the facets and filter out those whose  
> > > > > frequency=1, is there any better approach?

---

<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:** [June 27, 2011, 9:33pm UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/7 "2011-06-27T21:33:45Z")

</div>

Yea, you can open a feature request.

On Monday, June 27, 2011 at 11:13 AM, Cédric EXBRAYAT wrote:

> Shoul I open a proposal for a new feature on github or am I missing something ?
> 
> (Be able to filter facets with a minimum number of documents to request for example 'the users with at least 5 tweets during a week')
> 
> On Thu, Jun 23, 2011 at 3:32 PM, Cédric EXBRAYAT \<[cexbrayat@gmail.com](mailto:cexbrayat@gmail.com) ([mailto:cexbrayat@gmail.com](mailto:cexbrayat@gmail.com))\> wrote:
> 
> > In my case, it's a date histogram (but it can be any facet), and we'd like to return only the facets with a minimum number of documents.  
> > (for example : return the users with at least 5 tweets during a week).
> > 
> > The 'at least 5' part is the problem : we can filter manually but I was wondering if something can do the job in ES (as it can be done in SolR with a minCount).
> > 
> > On Thu, Jun 23, 2011 at 2:22 PM, Weiwei Wang \<[ww.wang.cs@gmail.com](mailto:ww.wang.cs@gmail.com) ([mailto:ww.wang.cs@gmail.com](mailto:ww.wang.cs@gmail.com))\> wrote:
> > 
> > > hi, shay,  
> > > i'm using TermsFacet to find the duplicate documents based on  
> > > certain field.
> > > 
> > > I have another question is that, i want to know the count of each term  
> > > and the ids associated with this term, the current version of ES  
> > > support this kind of operation?
> > > 
> > > On Jun 23, 7:56 pm, Shay Banon \<[shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com) ([mailto:shay.ba...@elasticsearch.com](mailto:shay.ba...@elasticsearch.com))\> wrote:
> > > 
> > > > Which facet are you referring to, the terms one?
> > > > 
> > > > On Thursday, June 23, 2011 at 10:41 AM, Cedric wrote:
> > > > 
> > > > > I've got a similar problem.
> > > > 
> > > > > In SolR, there is something like minCount on facets  
> > > > > [http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount](http://wiki.apache.org/solr/SimpleFacetParameters#facet.mincount)
> > > > 
> > > > > Am I missing something in elasticsearch to do that ?
> > > > 
> > > > > On 13 juin, 05:58, Weiwei Wang \<[ww.wang...@gmail.com](mailto:ww.wang...@gmail.com) ([mailto:ww.wang...@gmail.com](mailto:ww.wang...@gmail.com)) ([http://gmail.com](http://gmail.com))\> wrote:
> > > > > 
> > > > > > I need to returnfacetterms whosecount\>1, how could i achieve it?
> > > > 
> > > > > > Currently I can retrieve all the facets and filter out those whose  
> > > > > > frequency=1, is there any better approach?

---

<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:02am UTC](https://discuss.elastic.co/t/can-i-filter-facets-by-count-1/4610/8 "2017-07-06T04:02:27Z")

</div>


