In relational databases I am used to refer to descriptive fields by a key, and then make a lookup in order to retrieve the description. So updating the description doesn't have an impact on the query logic.
How is this solved in elasticsearch? In the frontend I want to show the address of a customer, but I don't want to store it in the elasticsearch document as it can change. Is there a concept to only store the customer ID in the document and show the address based on the lookup?
I know I could do it on the frontend, but it would require some refactoring there, what is a best practice for this very common scenario?
Elasticsearch does not support query time joins, so the recommended approach is generally to denormalise and store the customer address with the customer in the document.
I deeply agree with @Christian_Dahlqvist. Basically you need to forget what you learned and think "document" instead of relational technical implementation.
But use that only if the advice Christian shared does not work for you. I mean: don't try to fix problems you think you might have as you take the risk of over engineering your project
Okay I see. A change can happen every few days or weeks. When I have a couple of millions of documents, I would have to update them if there is a change in the masterdata. I thought there might be a better way, but is will work.
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.