# Question about facet classes

**URL:** <https://discuss.elastic.co/t/question-about-facet-classes/10000>\
**Category:** Elasticsearch\
**Created:** [December 8, 2012, 10:11pm UTC](https://discuss.elastic.co/t/question-about-facet-classes/10000 "2012-12-08T22:11:28Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [December 8, 2012, 10:11pm UTC](https://discuss.elastic.co/t/question-about-facet-classes/10000/1 "2012-12-08T22:11:28Z")

</div>

Hey there,

while taking a look at the existing additional facet implementations  
floating around, some questions raised to me:

1. Is a FacetProcessor instantiated per shard? As FacetProcessor.parse()  
uses a SearchContext as parameter, I cant think of another case.
2. If the above statement is true, then is there any last sort of reduce  
step for the per-shard results? If so, where does it happen? I havent found  
it in a quick peek...

If none of the above is true I am open for explanations what happens and  
how 🙂

Thanks and have a nice weekend!

--Alexander

--

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [December 9, 2012, 7:47am UTC](https://discuss.elastic.co/t/question-about-facet-classes/10000/2 "2012-12-09T07:47:54Z")

</div>

Hi Alexander,

You are correct, FacetProcessors are created per shard to generate an initial facet for the data on the shard. Tose facets are sent to the originating node ( the one that got the request from the client) where they are combined. This is also the responsibility of the FacetProcessor.

Here is a slide deck of a talk I gave which may help explaining: [Elastic search meetup 20/9/2012 | PPT](http://www.slideshare.net/bleskes/elastic-search-meetup-2092012)

Cheers,  
Boaz

On Saturday, December 8, 2012 11:11:28 PM UTC+1, Alexander Reelsen wrote:

> Hey there,
> 
> while taking a look at the existing additional facet implementations floating around, some questions raised to me:
> 
> 1. Is a FacetProcessor instantiated per shard? As FacetProcessor.parse() uses a SearchContext as parameter, I cant think of another case.
> 
> 2. If the above statement is true, then is there any last sort of reduce step for the per-shard results? If so, where does it happen? I havent found it in a quick peek...
> 
> If none of the above is true I am open for explanations what happens and how 🙂
> 
> Thanks and have a nice weekend!
> 
> --Alexander

--

---

<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:** [December 9, 2012, 4:08pm UTC](https://discuss.elastic.co/t/question-about-facet-classes/10000/3 "2012-12-09T16:08:08Z")

</div>

Hey Boaz,

I used your presentation as a reference already (thx for that one!)  
Just hadnt seen, that the FacetProcessor from the querying node is also  
responsible for calling reduce().. Will check the source for that.

Thanks for the clarification and have a nice weekend!

--Alexander

On Sun, Dec 9, 2012 at 8:47 AM, Boaz Leskes [b.leskes@gmail.com](mailto:b.leskes@gmail.com) wrote:

> Hi Alexander,
> 
> You are correct, FacetProcessors are created per shard to generate an  
> initial facet for the data on the shard. Tose facets are sent to the  
> originating node ( the one that got the request from the client) where they  
> are combined. This is also the responsibility of the FacetProcessor.
> 
> Here is a slide deck of a talk I gave which may help explaining:  
> [Elastic search meetup 20/9/2012 | PPT](http://www.slideshare.net/bleskes/elastic-search-meetup-2092012)
> 
> Cheers,  
> Boaz
> 
> On Saturday, December 8, 2012 11:11:28 PM UTC+1, Alexander Reelsen wrote:
> 
> > Hey there,
> > 
> > while taking a look at the existing additional facet implementations  
> > floating around, some questions raised to me:
> > 
> > 1. Is a FacetProcessor instantiated per shard? As FacetProcessor.parse()  
> > uses a SearchContext as parameter, I cant think of another case.
> > 
> > 2. If the above statement is true, then is there any last sort of reduce  
> > step for the per-shard results? If so, where does it happen? I havent found  
> > it in a quick peek...
> > 
> > If none of the above is true I am open for explanations what happens and  
> > how 🙂
> > 
> > Thanks and have a nice weekend!
> > 
> > --Alexander
> 
> --

--

---

<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:00am UTC](https://discuss.elastic.co/t/question-about-facet-classes/10000/4 "2017-07-06T03:00:42Z")

</div>

Closed on July 6, 2017, 3:00am UTC


