I am working on an app that has a few polymorphic associations. For
Comment may be child of Blog or Review, so when I search in the
comment type I would like to get the parent document of the query run
against the comment.content, that may be a blog or a review.
I see that the mapping ties the child to a fixed parent type, so that
doesn't seem to be possible at this time. I am missing something? Is
there any way to achieve that?
I would like to be able to index the child documents as:
curl -XPUT localhost:9200/app_index/comment/1001?
parent_type=blog&parent_id=1111 -d '
"content" : "this blog rocks"
curl -XPUT localhost:9200/app_index/comment/1002?
parent_type=review&parent_id=2222 -d '
"content" : "this review is fair"
In practice what I would like ES to have is the possibility to link a
child to any type of parent, explicitly, when the child is indexed. Is
that possible? Will it be possible?