I am trying to figured out the best practice to solve following case:
I have two data tables in sql db:
bank_accounts (one transaction has one bank account). And i would like to search thought the information of that tables by elastic search.
In my cases i need to find:
- All bank accounts contains the name.
- All transactions contains the bank name.
- All transaction contains the description.
So if i do store a bank account as nested data in every transaction i will get a lot of transactions with same nested data and when bank change the name (typo from manager for example) I will have to update all transactions containing the names of this bank, which looks not very optimised.
As well in that case i need to have two types:
transactions. In this case the transaction will contains duplicated information from bank accounts.
So, general question is how to structure the data to get most relatable solution for my cases.
I am very new in elastic search, so i hope the community to help me find the information to solve the case.