Hello! I have been working on a custom Elasticsearch plugin that should create an index template and its components when an Elasticsearch instance loads this plugin.
The only client that I can access is
NodeClient and there is no way to create
PutComposableIndexTemplateRequest as it is not available in the below dependency. (Maven)
<dependency> <groupId>org.elasticsearch</groupId> <artifactId>elasticsearch</artifactId> <version>7.17.6</version> <scope>provided</scope> </dependency>
I can create an index template with
client.admin().indices().putTemplate(...); method but there is no way to use the
ComposableIndexTemplate class with this client. If I need to add a dependency like
RestHighLevelClient, then I must set the host and port parameters to connect the cluster with this client even though this plugin is already running in an Elasticsearch cluster. It seems weird for the custom plugins, from my point of view.
Should I add this high-level client as a dependency and define host/port parameters? Or is there another way to add components to the ES instance?
Thanks in advance