Join and merge documents


(tao hiko) #1

Hi All,

My background is DBA (RDBMS) and starter for elasticsearch.
My question may duplicate to another question but I cannot find the answer
correctly.

My environment, I have 2 indexes and 1 document in each index as below

index : ind1
type : doc1
_id : running number not automatic generate id (1,2,3....xx)
name : string
status : string
last_update : date

index : ind2
type : doc2
_id : automatic generate id
doc_id : number
status : string
last_update : date

The relation is ind1.doc1._id = ind2.doc2.doc_id.

My purpose, I need to insert data from ind2.doc2 into ind1doc1 when it
doesn't exists in ind1.doc1 and update status and last_update fields when
it exist.

So Parent/Child method cannot use because data has been loaded to both
tables already.

Could you please advise me in this case? and Is this possible to use
aggregation or nested method across index? if not, How to join and merge
data in same index?

Thank you,
Hiko

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/abedffe2-f301-4255-8c2a-d3b89c74b585%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2