Ingest Plugin - Index new documents from within pipeline processor

Heya!

Is there a way to create/index new documents from within the context of a running pipeline processor?

Basically, I want to do this:

@Override
public IngestDocument execute(IngestDocument ingestDocument) throws Exception {
    final String someValue = ingestDocument.getFieldValue("someField", String.class);
    if(something(someValue)){
        ingestDocument.appendFieldValue("someAdditionalField","someAdditionalValue");
    }else {
        HashMap<String, Object> newDocument = new HashMap<>();
        newDocument.put("myFoo","myBar");
        newDocument.put("answer", 42);
        someCoolApi.indexDocument("my-other-index", newDocument);
    }
    return ingestDocument;
}

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