The dividend records of an ETF has a one-to-one relationship to the origin cf_etf index. It will be easy to embed the whole dividend records to the cf_etf index. Using a nested object datatype will make each object indexed as a separate hidden document internally. Let's add the announcement object field in the mappings of the cf_etf index and then change the announcement field from an object type to a nested object type, as follows:
{ "mappings": { "dynamic": false, "properties": { "symbol": {"type": "keyword"}, "fund_name": {"type": "text"}, ... "announcement":{ "type":"nested", "properties": { ...
In the GitHub repository of this chapter (https://github.com/PacktPublishing/Mastering-Elasticsearch-7.0/tree/master/Chapter07 ...