Using an array of objects datatype
As we have discussed in the previous sub-section, additional work is required to manually separate dividend records into a document to perform indexing. Another way is to embed all dividend records from the ETF into a parent document using an array of objects. In this approach, you need not index a lot of documents for a single ETF. However, when a new dividend is announced to an ETF, you need to update the corresponding document. Since the frequency of distributing dividend for ETFs is not that high, it seems that this approach may be the most suitable approach.
Let's practice using an array of objects to expand our system. From the aforementioned GitHub site (https://github.com/PacktPublishing/Mastering-Elasticsearch-7.0/tree/master/Chapter07 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access