# Using custom native plugin within embedded ES node

**URL:** <https://discuss.elastic.co/t/using-custom-native-plugin-within-embedded-es-node/14028>\
**Category:** Elasticsearch\
**Created:** [October 19, 2013, 3:18pm UTC](https://discuss.elastic.co/t/using-custom-native-plugin-within-embedded-es-node/14028 "2013-10-19T15:18:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://discuss.elastic.co/u/peter2)\
**Post date:** [October 19, 2013, 3:18pm UTC](https://discuss.elastic.co/t/using-custom-native-plugin-within-embedded-es-node/14028/1 "2013-10-19T15:18:56Z")

</div>

I have been using embedded ES nodes as a mean of easily unit/integration  
testing my search client code. But now I have a custom Native Script plugin  
and I was how I could tell the embedded ES node to use the custom Native  
Plugin.

1. Is it as simple as giving it a Settings with  
"script.native.myplugin.type: com.whatever.MyPluginFactory"?
2. When deploying the plugin to ES it needs to be under a subdirectory of  
plugin directory named "myplugin" as named above. Does this still matter or  
is it enough to have the MyPlugin jar in the maven dependencies (i.e.  
classpath)?

Thanks,  
Peter

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [October 20, 2013, 3:54pm UTC](https://discuss.elastic.co/t/using-custom-native-plugin-within-embedded-es-node/14028/2 "2013-10-20T15:54:36Z")

</div>

Hey,

it is enough to be in the class path and configure it via settings.  
Elasticsearch uses that mechanism, when the tests are run, see

[https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/script/NativeScriptTests.java](https://github.com/elasticsearch/elasticsearch/blob/master/src/test/java/org/elasticsearch/script/NativeScriptTests.java)

--Alex

On Sat, Oct 19, 2013 at 5:18 PM, [peter@vagaband.co](mailto:peter@vagaband.co) [peter@vagaband.co](mailto:peter@vagaband.co)wrote:

> I have been using embedded ES nodes as a mean of easily unit/integration  
> testing my search client code. But now I have a custom Native Script plugin  
> and I was how I could tell the embedded ES node to use the custom Native  
> Plugin.
> 
> 1. Is it as simple as giving it a Settings with  
> "script.native.myplugin.type: com.whatever.MyPluginFactory"?
> 2. When deploying the plugin to ES it needs to be under a subdirectory of  
> plugin directory named "myplugin" as named above. Does this still matter or  
> is it enough to have the MyPlugin jar in the maven dependencies (i.e.  
> classpath)?
> 
> Thanks,  
> Peter
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://discuss.elastic.co/u/peter2)\
**Post date:** [October 21, 2013, 12:34am UTC](https://discuss.elastic.co/t/using-custom-native-plugin-within-embedded-es-node/14028/3 "2013-10-21T00:34:36Z")

</div>

Perfect. That worked. Thanks a lot.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:11am UTC](https://discuss.elastic.co/t/using-custom-native-plugin-within-embedded-es-node/14028/4 "2017-07-06T02:11:30Z")

</div>


