Currently we have two indices , like below
index A including fields with user, targetIds (list type)
index B including fields with id, targetId
And we want to query from indexB with permission applied, one login user can only see the target id list defined in index A,
For now , we are using application joins, first query the targetIds from index A using the login user,
then add filter in indexB query DSL to apply the permission
So my question is
Since ES doesn't support joinQuery except using parent/child, nested, etc ,
can we use some other methods like some kind of plugin to achieve this ?
For example we create custom plugin to define a new queryparser to support the sub query ?
or define a custom filter in query DSL to get all targetIds first and then add back to the query ?
Maybe we also can do some remote api call in the custome filter in order to apply our permission
By the way
From the elasticsearch guide, we found that there exists a hidden index '.security'
if we add login user and targetIds to this index , ES will automatically do the filtering for us in the query result . So is there anything we can use for reference from this .security design ?