RE: Removal of mapping types https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html
It looks like the proposed solution is to use a "common key" - my term. Such a common key can tie a user to a tweet, as in the example, but let's get serious, and talk about more complex, and I suspect, more common, and realistic use cases, shall we?
Let's say I have a FACTORY, and I make PRODUCT. I have a supply chain of numerous different VENDORS, who sell me various PARTS, INGREDIENTS, PACKAGES, and SYSTEMS that I use at various STAGES in my manufacturing PROCESSES. That doesn't even begin to get into distributors, shippers, customers, retail outlets, regulators, product managers, and so on. How do I track those relationships?
Parent-child could tie a PRODUCT to all the relevant PARTS, but not further to the relevant VENDORS. That's a 3 generation parent child, which is no longer recommended. So then what, a "common key" for all 3 fields? Make up a custom field, which is essentially the uuid of the PRODUCT, and then make that the common field for every other document that is related to it? Because if I understand this correctly, all those other documents would be in a different index and therefore, by definition, of a different type?
It seems nesting does not solve this problem and can't, because it follows that you can't nest documents of a different type, right?
This sounds like a nightmare for those that need relationships. How do you facet without relations? How do you do a recommendation engine? How do you do any analytics if you can't require relations?
I looked at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html, but that seems to assume even more denormalization, so that, for example, a full text search would pick up common terms (like the name of the same VENDOR) in a query result.
Hopefully, I am too new at this to know there is a simple solution used by those with similar data. I hope to learn that in your response.