I am new to Elasticsearch, and there seems to be some really good features in this tool
I have explored it for a few days, and I am currently trying to decide which model type would be preferable. I made a small example of the type of data I am working with. It is not exactly what I am working with, but close to it
Using this model as an example, I will be required to do queries like find questions by text, find answers by text, find comments by text and get all questions that have comments. So you see, my problem is that I don't really know how I could organise my data in Elasticsearch so that all those queries would be efficient.
Would it be better to use a nested object model or a parent/child model ?
@dadoonet is right, as far as Elastic is for search (relevance and speed) it is better to denormalize as much as you can prior to use nested or parent/child relations.
For instance, nested types are stored as different Lucene objects and they are put together in query time (it has a high cost).
I understand that I have to denormalize my data and they actually are already denormalized. The problem is that I have to link them together somewhere. Would it be more efficient to have them linked already in the index or to do multiple queries?
Also, with your model, is it possible to query for "answers that have comments"?
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.