# Granted documents query

**URL:** <https://discuss.elastic.co/t/granted-documents-query/274053>\
**Category:** Kibana\
**Tags:** elastic-stack-security\
**Created:** [May 26, 2021, 12:03pm UTC](https://discuss.elastic.co/t/granted-documents-query/274053 "2021-05-26T12:03:10Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [May 26, 2021, 1:33pm UTC](https://discuss.elastic.co/t/granted-documents-query/274053/2 "2021-05-26T13:33:49Z")

</div>

Hi @mar-ro

Perhaps take a look at this similar post [here](https://discuss.elastic.co/t/api-key-and-document-level-security-query-not-limiting-response/271786/4)

In short I suspect you should be using a `term` query with fields that are of type `keyword`.

The example in the post about uses an API key but the concept is the same.

And using a filter is good approach as well.

---

_[View the full topic](https://discuss.elastic.co/t/granted-documents-query/274053)._
