Help in Relationship Mapping

I have related objects. Want to know what should be the mapping and how it
should be stored in elastic search.
For example base object is
Blog
id
name
subject
body

multiple comments can be related to same blog.

Comment
blog id
comment id [type string]
comment username [type string]
comment review [type int value between 1-5]
comment body [type string]

Usecase is

  1. Given some blog properties and comment properties return the blog that
    matches the criteria
  2. Given some comment properties and blog properties return all comment id
    that matches the criteria.

example:
Blog
id = "1"
name = "blog1"
subject = "new blog"
body = "blog body"

Comment

blog id = "1"
comment id = "c1"
comment username = "name1"
comment review = 2
comment body = "body1"

blog id = "1"
comment id = "c2"
comment username = "name2"
comment review = 2
comment body = "body2"

blog id = "1"
comment id = "c3"
comment username = "name3"
comment review = 1
comment body = "body3"

blog id = "1"
comment id = "c4"
comment username = "name4"
comment review = 1
comment body = "body4"

Query

  1. Given subject and review get all blog id (result should be blog with id
  1. Given blog subject and comment review get all comment id (result should
    be comment id c1 and c2 for subject ="new blog" and review = 2)

What should be my mapping in Elastic search?

As per I know we can store related document in 3 ways
data denormalized way (data will be duplicated)
nested document (will not be able search for nested object)
Parent child relationship (will be slow compared to other options)

Number of blog documents will be around 22 million and each document can
have 15 comment.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6a2119f3-f4fc-498b-afb0-82609d2ce770%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.