# How to pass parameters to FacetProcessor.reduce?

**URL:** <https://discuss.elastic.co/t/how-to-pass-parameters-to-facetprocessor-reduce/9711>\
**Category:** Elasticsearch\
**Created:** [November 14, 2012, 9:00am UTC](https://discuss.elastic.co/t/how-to-pass-parameters-to-facetprocessor-reduce/9711 "2012-11-14T09:00:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [November 14, 2012, 9:00am UTC](https://discuss.elastic.co/t/how-to-pass-parameters-to-facetprocessor-reduce/9711/1 "2012-11-14T09:00:15Z")

</div>

I can read parameters in FacetProcessor.parse and pass them to a  
FacetCollector, but how do I pass parameters to FacetProcessor.reduce?

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 14, 2012, 2:17pm UTC](https://discuss.elastic.co/t/how-to-pass-parameters-to-facetprocessor-reduce/9711/2 "2012-11-14T14:17:07Z")

</div>

FacetCollector can store these parameters in Facet, and  
then FacetProcessor.reduce can retrieve them form one of the Facets it  
receives to reduce.

On Wednesday, November 14, 2012 4:00:15 AM UTC-5, Eric Jain wrote:

> I can read parameters in FacetProcessor.parse and pass them to a  
> FacetCollector, but how do I pass parameters to FacetProcessor.reduce?

--

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [November 15, 2012, 7:11am UTC](https://discuss.elastic.co/t/how-to-pass-parameters-to-facetprocessor-reduce/9711/3 "2012-11-15T07:11:09Z")

</div>

On Wed, Nov 14, 2012 at 6:17 AM, Igor Motov [imotov@gmail.com](mailto:imotov@gmail.com) wrote:

> FacetCollector can store these parameters in Facet, and then  
> FacetProcessor.reduce can retrieve them form one of the Facets it receives  
> to reduce.

Thanks! Too bad you can't create a custom FacetReducer (similar to the  
FacetCollector), but that works.

--

---

<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:04am UTC](https://discuss.elastic.co/t/how-to-pass-parameters-to-facetprocessor-reduce/9711/4 "2017-07-06T03:04:10Z")

</div>

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


