Document - User mapping in DLS


In our search index we want to specify access at very granular level. For eg. Say we have doc1, doc2, doc3 in index and user1 has access to doc1 and doc2, similarly user2 to doc2 and doc3, user3 to doc3 and doc1. There is no field or pattern that we can use to generalize the query in DLS. The mapping between user and documents are decided at individual user and document level. The number if users are above 10k and documents in millions. That makes it impractical to store userIds with each document.

Is there a way to achieve this using document level security? Or any other suggestions on how to solve this in opensearch ?


@Matt90 What type of authentication and authorization do you use?