Ingest plugin - access data, perform request

Hi,

I'm writing ingest plugin for elasticsearch. It is going to calculate a diff, between the document being inserted and the latest one in the ES, and save diff as a new field.

So far so good, yet I did not find a way to access the data, not perform any requests.

Plugin signature looks as follow:
MyPlugin extends Plugin implements IngestPlugin

Am I missing something obvious, is there any way to achieve that?

I am aware of Client, SearchService classes but I did not find a way to get to them (@Inject annotation on Plugin only allows Settings instance to be passed).

There is a method in Plugin called:

    public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
                                               ResourceWatcherService resourceWatcherService, ScriptService scriptService,
                                               NamedXContentRegistry xContentRegistry) {

You can override this to get a reference to a client

Hope that helps

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