Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save UpOutServers/9a4466108d12452738e9 to your computer and use it in GitHub Desktop.
Save UpOutServers/9a4466108d12452738e9 to your computer and use it in GitHub Desktop.
Plugin file with REST and native script modules for elasticsearch
package org.elasticsearch.plugin.myplugin;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.rest.RestModule;
import org.elasticsearch.script.ScriptModule;
public class MyPlugin extends AbstractPlugin {
public String name() {
return "MyPlugin";
}
public String description() {
return "MyPlugin";
}
public void onModule(RestModule module) {
module.addRestAction(/*Your rest class*/);
}
public void onModule(ScriptModule module) {
module.registerScript(/*Your script name*/ ,/*Your script class*/);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment