My goal is to test the invocation of some in-house software from within an ES plugin. My approach was to make a simple, Hello World style plugin that would print to the ES log/console. If I can see my log output, then I know when my code path is being triggered. This way, I can hook in my desired invocation, and know when it is being invoked.
Using the examples from the source code, I was able to make a bare-bones NativeScriptPlugin (I prefer this type of plugin for other reasons). It compiles, and the plugin zip installs without error, but I cannot seem to invoke it. That is my problem. I think the root problem is my lack of understanding of the plugin system and ES, but I am not really seeing any docs with any detail. I only see the docs on "Help for plugin authors", but that is minimal.
Here is the curl I use to try and invoke my plugin.
The name of the script is correct. I am using ES 5.5.2.
I've tried debugging into the plugin, which works, but doesn't enter the `run()` method of the plugin. I have the `run()` method doing a `System.out.println`, hoping to see something in the ES console output. Sadly, none of this worked as I expected.
Do you have any documents in your index? A search script is run for each document matching the query (in this case, all documents in the index). Additionally, printing to stdout will be a black hole, depending on how you started elasticsearch, and it definitely will not go the the elasticsearch log. You need to construct a Logger for your class and log at a level that is visible (by default, INFO and above).