Does ES join support composite key?

--my parent document looks like below

PUT example3/_doc/9
{
"userId":9999
"accountId":101,
}

--

PUT example3/_doc/10
{
"userId":9999
"accountId":102,
}
---my child look like below

PUT example3/_doc/11
{
"accountId":101,
"contactId":201
}

PUT example3/_doc/11
{
"account":102,
"contactId" :301
}
i want to perform join based on accountId . i thought of using mapping like below but still confused with parent_id and routing. i don't want o use Nested object in this case because it prevent me to update parent and child separately .
.
PUT example3
{
"mappings": {
"properties": {
"join": {
"type": "join",
"relations": {
"coverage": "readership"
}
}
}
}
}

Hey,

please format code snippets properly, that makes them much more readable and this forum has full markdown support.

Can you please explain what is not working as expected, and how you expect things to work. Please provide some context instead of just dropping some code snippets in an wrong order that makes it hard to reproduce for others.

If you are using the join datatype, make sure that parent/child documents are on the same shard (if you have not changed the shard count, it is one and it's fine).

Also, please show a sample query that is not working es expected instead of just the mapping.

Thank you!