Joining two documents into one single document in Elastic 6.3?


(Surya) #1

Can we join two documents into one single document(nested) in Elastic 6.3?

Like.. I have student and department as two documents.

Can I add department document as a nested array in student document into some other index?

Eg: Student{.....department[....]}

thanks,
Surya


(Igor Motov) #2

It is possible to do with a logstash configuration that consists of elasticsearch input (to read students), elasticsearch filter (to lookup departments), and elasticsearch output (to index the joined records back into elasticsearch).


(Surya) #3

Thanks for the response, So using logstash can we make a document to be nested in some other document? Can this be done inside logstash filter?


(Igor Motov) #4

So using logstash can we make a document to be nested in some other document?

Yes, you define the document as nested in the mapping, and then you use logstash to create a source that would match this nested structure.


(system) #5

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