Multiple join type fields in a index

I want to confirm I have to achieve a scenario where I want to filter those who blocked_me or I blocked, is the any support of multiple join types in current ES version

       "join_type1": {
            "type": "join",
            "relations": {
                "user": [
                    "blocked"
                ],
                "post": "views"
            }
        },
        "join_type2": {
            "type": "join",
            "relations": {
                "user": [
                    "block"
                ],
            }
        }

Received following error

[illegal_argument_exception] Field [_parent_join] is defined twice in [doc] 

A document can have multiple children, but each document can only have a single parent.

1 Like

So you mean if I want to make 2 foreign keys in a children, then I have to make at least copy of children to entertain other foreign key ?

That may be one approach, but it may also be better to not think about the problem in a relational way. If you can describe the requirements and how you need to be able to query the data, someone might be able to provide an alternative approach. What is the expected cardinality between entities? How often are they created, deleted or modified?

Actually I donot update document again again
Actually I want to filter those users who blocked me or I blocked them
Suppose
"A" user blocked "B"
"C" user blocked "A"

current user is "A" and he is viewing list of users, he should not be able to see "B" and "C" both

If I make a User as parent and block and child model , then I can only access one point either blocked by me or some blocked me

I am confuse to implement this scenario. I am looking a copies blocked Model.
If you have a better solution. then kindly recommend me

Thanks

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