# Can't retrieve documents for system index by \_count, \_doc, \_search

**URL:** <https://forum.opensearch.org/t/cant-retrieve-documents-for-system-index-by-count-doc-search/18549>\
**Category:** Security\
**Tags:** troubleshoot\
**Created:** [March 25, 2024, 4:57pm UTC](https://forum.opensearch.org/t/cant-retrieve-documents-for-system-index-by-count-doc-search/18549 "2024-03-25T16:57:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![leedonggyu](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@leedonggyu](https://forum.opensearch.org/u/leedonggyu)\
**Post date:** [March 25, 2024, 4:57pm UTC](https://forum.opensearch.org/t/cant-retrieve-documents-for-system-index-by-count-doc-search/18549/1 "2024-03-25T16:57:45Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):

opensearch version: 2.11.1

**Describe the issue** :

System index has been set up and permissions have been set successfully.  
indexing is possible in the system index, but `_search`, `_doc`, `_count` query returns only 0 data. why does the query return only 0 data?

There is no permission error, but 0 data is always returned.

#### API responses

- POST {system\_index}/\_doc/1
  - indexing success

- GET \_cat/indices?v
  - system index’s doc count increased

* * *

- GET {system\_index}/\_doc/1
  - Not found

- GET {system\_index}/\_count
  - return 0

- GET {system\_index}/\_search
  - hit 0

> I accessed the system index by `manager` user by below configuration

**Configuration** :

- security config

- roles config

- internalusers config

**Relevant Logs or Screenshots** :

---

<div class="post-metadata">

**Author:** ![Eugene7](https://avatars.discourse-cdn.com/v4/letter/e/bbce88/32.png) [@Eugene7](https://forum.opensearch.org/u/Eugene7)\
**Post date:** [March 25, 2024, 5:34pm UTC](https://forum.opensearch.org/t/cant-retrieve-documents-for-system-index-by-count-doc-search/18549/2 "2024-03-25T17:34:38Z")

</div>

Hi @leedonggyu

Could you please describe or send a link for your blow configuration ? I haven’t found anything in the OS docs about that.

---

<div class="post-metadata">

**Author:** ![leedonggyu](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@leedonggyu](https://forum.opensearch.org/u/leedonggyu)\
**Post date:** [March 25, 2024, 5:39pm UTC](https://forum.opensearch.org/t/cant-retrieve-documents-for-system-index-by-count-doc-search/18549/3 "2024-03-25T17:39:12Z")

</div>

@Eugene7

I refer to system index documents

- [System indexes - OpenSearch Documentation](https://opensearch.org/docs/2.12/security/configuration/system-indices/)
- [Permissions - OpenSearch Documentation](https://opensearch.org/docs/latest/security/access-control/permissions/#system-index-permissions)

---

<div class="post-metadata">

**Author:** ![Gsmitt](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/gsmitt/32/1718_2.png) [@Gsmitt](https://forum.opensearch.org/u/Gsmitt)\
**Post date:** [March 26, 2024, 12:51am UTC](https://forum.opensearch.org/t/cant-retrieve-documents-for-system-index-by-count-doc-search/18549/4 "2024-03-26T00:51:28Z")

</div>

hey @leedonggyu

From the link you posted , it states…

> you first need to authenticate with an admin certificate to gain access:

Have you tried something like this?

```auto
curl -k --cert ./kirk.pem --key ./kirk-key.pem -XGET 'https://localhost:9200/.opendistro_security/_search'

```
