I searched the forum and internet in general, but i couldn't find clear
answers about the differences in scoring. And most of the answers are
pretty old. I would like to know all the important current
differences/comparison between nested and parent-child documents.
What i understood so far
- parent and child are two different lucene docs (and guaranteed to be in
same shard). nested docs are stored as a separate doc using some internal
representation and they are also in the same shard as parent doc.
- using nested document gives significantly better performance compared to
- any update to a nested document will trigger the whole parent document
to be reindexed, but any update to child will reindex only the child doc
- when you apply a filter on nested field, the filter will work but all
the nested docs will be returned along with the parent (its a feature in
progress https://github.com/elasticsearch/elasticsearch/issues/3022 ). we
do not have this problem with parent-child.
Questions or need to confirm my understanding
- using nested documents will let me sort the documents based on fields in
the nested documents, on the other hand i cannot sort by fields in child
docs. (feature in progress
- filtering results based on a field is possible with both nested and
I am curious to know other differences from ranking/scoring perspective. I
would ideally like to score the parent documents by an aggregate function
(sum or avg) of a nested/child field. Any thoughts anyone ?
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8183aa8d-1efc-40e5-8555-120bca8ff426%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.