# Merging output of one facet in another facet input

**URL:** <https://discuss.elastic.co/t/merging-output-of-one-facet-in-another-facet-input/16747>\
**Category:** Elasticsearch\
**Created:** [April 1, 2014, 8:18pm UTC](https://discuss.elastic.co/t/merging-output-of-one-facet-in-another-facet-input/16747 "2014-04-01T20:18:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikrant\_mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vikrant_mahajan/32/1677_2.png) [@vikrant\_mahajan](https://discuss.elastic.co/u/vikrant_mahajan)\
**Post date:** [April 1, 2014, 8:18pm UTC](https://discuss.elastic.co/t/merging-output-of-one-facet-in-another-facet-input/16747/1 "2014-04-01T20:18:37Z")

</div>

I have a facet which returns proper no of terms but lesser no of count as  
many documents have that field missing

I have another field in documents which have that field missing which  
contains that term but also other unrelated junk terms also.

I want to run first the first facet and get the correct faceted terms and  
then run second facet on different field but want to return only those  
terms which are also sent by first facet too.and then agregate the result.

this way i will be able to ignore junk and get proper output of counts.

Can it be done ??

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f0d6ae1c-5ec7-4382-b995-c6f1592cab03%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f0d6ae1c-5ec7-4382-b995-c6f1592cab03%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:38am UTC](https://discuss.elastic.co/t/merging-output-of-one-facet-in-another-facet-input/16747/2 "2017-07-06T01:38:55Z")

</div>

Closed on July 6, 2017, 1:38am UTC


