Parent-Child nested mapping


#1

Hi, I'd like to map the following structure:

  • I have blog posts
  • Blog posts can have comments
  • Comments can have replies (which are also comments)

POST -------> COMMENT
COMMENT -----
---> COMMENT

Here's what I tried:

mappings: {
    "comment": {
        "properties": {
            "content": { "type": "string" },
            "replies": { "type": "comment" }
        }
    },
    "post": {
        "properties": {
            "comments": {
                  "type": "comment"
             }
        }
    }
}

Of course it's not working. How can I achieve this?


#2

See this solution for the problem on stackoverflow


(system) #3