Hi @michael.hunger
I have 2 indices in elastic data
Account, Payments
Account has AccountNo, AccBalance, CustomerNo
Payments has TrxID, Amount, AccountNo, CustomerNo, PartyNo
AccountNo and CustomerNo in both are foreign keys
First I created Indexes
CREATE INDEX ON :Account(AccountNo)
CREATE INDEX ON :PayTransactions(TrxID)
CREATE INDEX ON :Customer(CustomerNo)
Then I created vertex for all Accounts
CALL apoc.es.query('localhost:9200','account','doc','size=20',null) yield value with value.hits.hits as hits
UNWIND hits as hit
UNWIND hit._source AS account
MERGE (A1:Account {AccountNo: account.AccountNo, AccBalance: account.AvailableBalance})
MERGE (A2:Customer {CustomerNo: account.CustomerNo})
MERGE (A1)-[:CUST_NO]->(A2)
return A1,A2
Then I created vertex for Payments
CALL apoc.es.query('localhost:9200','payments','doc','size=20',null) yield value with value.hits.hits as hits
UNWIND hits as hit
UNWIND hit._source AS paytrans
MERGE (P1:PayTransactions {TrxID: paytrans.TrxID, TransAmount: paytrans.TransactionAmount})
MERGE (P2:Account {AccountNo: paytrans.AccountNo})
MERGE (P3:Customer {CustomerNo: paytrans.CustomerNo})
MERGE (P4:Customer {CustomerNo: paytrans.CounterpartyAccID})
MERGE (P1)-[:ACC_NO]->(P2)
MERGE (P1)-[:CUST_NO]->(P3)
MERGE (P1)-[:CPARTY]->(P4)
return P1, P2, P3, P4
How to get the CustomerNo to get shown in the purple vertex
May I have some help please
Thanks in Advance