I have some data that are 1 to n relationship, what should I do to store
the data and query them?
Has anyone came to this situation ?
e.g.
I have the item model,but also, per item has many order,if I want to query
both the item and order,it is difficult, I have learned about that the
parent child relationship can solve this query,but it is not perfect, it
can't sort on the child filed
Denormalize your data. This is highly dependent on your data upgrade
patterns and can possibly result in a bad performance or complex
application/update logic
Use Parent/Child to prevent heavy updates (because you can have a
relation between employee and employer for example, but still index those
entries as completely different documents)
Use nested documents to execute more complex queries, but still keep
everything in one document
A couple of links (the blog post contains many links to the elasticsearch
documentations)
I have some data that are 1 to n relationship, what should I do to store
the data and query them?
Has anyone came to this situation ?
e.g.
I have the item model,but also, per item has many order,if I want to query
both the item and order,it is difficult, I have learned about that the
parent child relationship can solve this query,but it is not perfect, it
can't sort on the child filed
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.