Hi all, We have implemented some security on our index by adding a field 'groups_allowed' to documents, and wrap a boolean must query around the original query, that checks if one of the given user-groups matches at least one groups_allowed.
We chose to leave the groups_allowed field empty when the document should able to be retrieved by all users, so we need to also select a document if the 'groups_allowed' is empty. What would be the faster Query construction to do so? Currently I use a TermRangeQuery that basically matches all values and put that in a MUST_NOT combined with a MatchAllDocumentQuery(), but that gets rather slow then the number of groups is high. Thanks!