Add new relations after creating the mapping

Hi, I'm currently having the same question as #103827
Say I've already created a relation in the mapping:

PUT my_index
{
  "mappings": {
    "_doc": {
      "properties": {
        "my_join_field": { 
          "type": "join",
          "relations": {
            "question": "answer" 
          }
        }
      }
    }
  }
}

Now, if I want to add another child named "Comment" to the current parent question, is there any way that I can achieve this?
I know that once you create the mapping, you cannot update it, but I also saw this on join dataytpe page:


So please help

I would expect the following to work, to update the mappings with the new comment child type:

PUT my_index/_mapping/_doc
{
  "properties": {
    "my_join_field": {
      "type": "join",
      "relations": {
        "question": [
          "answer",
          "comment"
        ]
      }
    }
  }
}

If you run into problems with this, please post the error messages that you're gettings and documents that cause problems.

It works! Thank you so much

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.