# Facet on combination of fields

**URL:** <https://discuss.elastic.co/t/facet-on-combination-of-fields/12313>\
**Category:** Elasticsearch\
**Created:** [June 7, 2013, 6:33am UTC](https://discuss.elastic.co/t/facet-on-combination-of-fields/12313 "2013-06-07T06:33:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_Jain](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ankit\_Jain](https://discuss.elastic.co/u/Ankit_Jain)\
**Post date:** [June 7, 2013, 6:33am UTC](https://discuss.elastic.co/t/facet-on-combination-of-fields/12313/1 "2013-06-07T06:33:01Z")

</div>

Hi All,

We want to perform facets on combination of fields.

For example:  
Lets consider, my index contains two columns: column1 and column2. And we  
want to perform facets on combination of fields. Below is the expected  
output.

column1 column2 count  
abc pqw 10  
abc asd 20  
asd pqw 12

Please share ways to achieve above scenario in elasticsearch.

Thanks,  
Ankit Jain

--  
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:** ![sslhj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sslhj/32/119856_2.png) [@sslhj](https://discuss.elastic.co/u/sslhj)\
**Post date:** [June 7, 2013, 7:29am UTC](https://discuss.elastic.co/t/facet-on-combination-of-fields/12313/2 "2013-06-07T07:29:59Z")

</div>

hi,  
es can do terms facet against multi fields,  
[http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet/](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet/)

---

<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:** [June 7, 2013, 7:54am UTC](https://discuss.elastic.co/t/facet-on-combination-of-fields/12313/3 "2013-06-07T07:54:50Z")

</div>

Hey,

check out the terms script feature in the terms facet

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

--Alex

On Fri, Jun 7, 2013 at 8:33 AM, Ankit Jain [ankitjaincs06@gmail.com](mailto:ankitjaincs06@gmail.com) wrote:

> Hi All,
> 
> We want to perform facets on combination of fields.
> 
> For example:  
> Lets consider, my index contains two columns: column1 and column2. And we  
> want to perform facets on combination of fields. Below is the expected  
> output.
> 
> column1 column2 count  
> abc pqw 10  
> abc asd 20  
> asd pqw 12
> 
> Please share ways to achieve above scenario in elasticsearch.
> 
> Thanks,  
> Ankit Jain
> 
> --  
> 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:** ![Ankit\_Jain](https://avatars.discourse-cdn.com/v4/letter/a/96bed5/32.png) [@Ankit\_Jain](https://discuss.elastic.co/u/Ankit_Jain)\
**Post date:** [June 7, 2013, 10:05am UTC](https://discuss.elastic.co/t/facet-on-combination-of-fields/12313/4 "2013-06-07T10:05:41Z")

</div>

It works for me... Thanks you very much.

~Ankit

On Friday, 7 June 2013 13:24:50 UTC+5:30, Alexander Reelsen wrote:

> Hey,
> 
> check out the terms script feature in the terms facet  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet/)
> 
> --Alex
> 
> On Fri, Jun 7, 2013 at 8:33 AM, Ankit Jain \<[ankitj...@gmail.com](mailto:ankitj...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hi All,
> > 
> > We want to perform facets on combination of fields.
> > 
> > For example:  
> > Lets consider, my index contains two columns: column1 and column2. And we  
> > want to perform facets on combination of fields. Below is the expected  
> > output.
> > 
> > column1 column2 count  
> > abc pqw 10  
> > abc asd 20  
> > asd pqw 12
> > 
> > Please share ways to achieve above scenario in elasticsearch.
> > 
> > Thanks,  
> > Ankit Jain
> > 
> > --  
> > 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:** ![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:32am UTC](https://discuss.elastic.co/t/facet-on-combination-of-fields/12313/5 "2017-07-06T02:32:21Z")

</div>


