# Instantiating elasticsearch processors in custom processor

**URL:** <https://discuss.elastic.co/t/instantiating-elasticsearch-processors-in-custom-processor/328199>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [March 21, 2023, 10:16pm UTC](https://discuss.elastic.co/t/instantiating-elasticsearch-processors-in-custom-processor/328199 "2023-03-21T22:16:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaptainAmericaFan2](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@CaptainAmericaFan2](https://discuss.elastic.co/u/CaptainAmericaFan2)\
**Post date:** [March 21, 2023, 10:16pm UTC](https://discuss.elastic.co/t/instantiating-elasticsearch-processors-in-custom-processor/328199/1 "2023-03-21T22:16:02Z")

</div>

Hi! I'm hoping to run language inference over a number of fields as documented in this blog: [Multilingual search using language identification in Elasticsearch | Elastic Blog](https://www.elastic.co/blog/multilingual-search-using-language-identification-in-elasticsearch)

Because I want to run it over a number of fields, I'm hoping I can centralise this logic, rather than having ~6 processors for each field. I was hoping I could put the processors for this logic in a pipeline and then call that pipeline with the pipeline processor and pass in a parameter however this isn't possible.

My new port of call is to create a custom processor in a plugin and instantiate the processors I want in the custom processor, chaining the execute statements. I can't seem to instantiate these though. Am I missing a trick - is this possible or is there a better way to do this?

Thanks!

---

<div class="post-metadata">

**Author:** ![Keith\_Massey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/keith_massey/32/83666_2.png) [@Keith\_Massey](https://discuss.elastic.co/u/Keith_Massey)\
**Post date:** [March 22, 2023, 1:03pm UTC](https://discuss.elastic.co/t/instantiating-elasticsearch-processors-in-custom-processor/328199/2 "2023-03-22T13:03:47Z")

</div>

Just curious -- do you see performance problems when you put all 6 processors explicitly into your pipeline? Or is your goal a simpler pipeline definition?

---

<div class="post-metadata">

**Author:** ![CaptainAmericaFan2](https://avatars.discourse-cdn.com/v4/letter/c/22d042/32.png) [@CaptainAmericaFan2](https://discuss.elastic.co/u/CaptainAmericaFan2)\
**Post date:** [March 24, 2023, 11:47am UTC](https://discuss.elastic.co/t/instantiating-elasticsearch-processors-in-custom-processor/328199/3 "2023-03-24T11:47:50Z")

</div>

Simpler pipeline definition - feels like a code smell to have the same 5 processors repeated for each field I want to run language inference on

---

<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:** [April 21, 2023, 11:48am UTC](https://discuss.elastic.co/t/instantiating-elasticsearch-processors-in-custom-processor/328199/4 "2023-04-21T11:48:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
