# Custom Facet type as plugin

**URL:** <https://discuss.elastic.co/t/custom-facet-type-as-plugin/7374>\
**Category:** Elasticsearch\
**Created:** [April 18, 2012, 8:48am UTC](https://discuss.elastic.co/t/custom-facet-type-as-plugin/7374 "2012-04-18T08:48:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igor\_Semenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_semenko/32/2911_2.png) [@Igor\_Semenko](https://discuss.elastic.co/u/Igor_Semenko)\
**Post date:** [April 18, 2012, 8:48am UTC](https://discuss.elastic.co/t/custom-facet-type-as-plugin/7374/1 "2012-04-18T08:48:33Z")

</div>

Is there way to deliver custom facet type without patching ES? I developed  
a new facet type needed for my project, but I have to patch FacetModule's  
constructor (add to processors) to get it working.

It would be nice to declaratively add new facets thru configuration or  
plugin infrastructure. Any plans on that?

Thanks

---

<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:** [April 18, 2012, 4:31pm UTC](https://discuss.elastic.co/t/custom-facet-type-as-plugin/7374/2 "2012-04-18T16:31:31Z")

</div>

On Apr 18, 1:48 am, Igor Semenko [i...@semenko.com](mailto:i...@semenko.com) wrote:

> It would be nice to declaratively add new facets thru configuration or  
> plugin infrastructure. Any plans on that?

+1

---

<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:** [April 19, 2012, 7:29pm UTC](https://discuss.elastic.co/t/custom-facet-type-as-plugin/7374/3 "2012-04-19T19:29:02Z")

</div>

Igor,

You can add your facet using plugin infrastructure. If you are using 0.19  
or later, all you have to do is add the following method to your Plugin  
class:

```
public void onModule(FacetModule facetModule) {
    facetModule.addFacetProcessor(MyFacetsProcessor.class);
}

```

Before 0.19 you can do the same thing using processModule method.

Igor

On Wednesday, April 18, 2012 12:31:31 PM UTC-4, Eric Jain wrote:

> On Apr 18, 1:48 am, Igor Semenko [i...@semenko.com](mailto:i...@semenko.com) wrote:
> 
> > It would be nice to declaratively add new facets thru configuration or  
> > plugin infrastructure. Any plans on that?
> 
> +1

---

<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:31am UTC](https://discuss.elastic.co/t/custom-facet-type-as-plugin/7374/4 "2017-07-06T03:31:50Z")

</div>


