Elasticsearch insert triggers


#1

Hi,
I have a use case where when a certain document is indexed, based on the fields in the newly inserted document, I would like to index another document in a different index. The expected behavior is somewhat similar to an insert trigger in SQL Server. How can this be done? What are some of the options in Elasticsearch?
Thanks for your help!


#2

Hi, I am looking for information on this still. Any help is greatly appreciated. When a document comes in, would like to do the following:

  1. Search another index for certain documents based on a few fields of the incoming document
  2. Then create a new document which is a "derived" document and index it into a another index
  3. Proceed with indexing the current incoming document

I have looked at the ingest node custom processor plugin as one of the potential options but not sure if it is capable of doing something like this and what are some of the pitfalls to watch out for?
Also is there another solution available?

Thanks
Priya


(Christian Dahlqvist) #3

The ingest node can as far as I know only modify the current document, not create new ones, so you will need to do this before you send the data to Elasticsearch.


#4

Thank you for your reply. Sorry for the delay. Ingest pipeline is what I was thinking to implement for this. The pipeline could have a custom processor that would do this. Can you please confirm if this is a viable solution? Would exposing a custom REST API end point in elasticsearch an option too? If both can do this, is one preferred over another?

Thanks for your time.


(Christian Dahlqvist) #5

I clarified my previous response as I now realised it was confusing.


(system) #6

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