# Filter fields on list documents?

**URL:** <https://discuss.elastic.co/t/filter-fields-on-list-documents/201893>\
**Category:** Elastic Search\
**Tags:** elastic-site-search\
**Created:** [October 2, 2019, 4:56am UTC](https://discuss.elastic.co/t/filter-fields-on-list-documents/201893 "2019-10-02T04:56:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sophistifunk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sophistifunk/32/55224_2.png) [@Sophistifunk](https://discuss.elastic.co/u/Sophistifunk)\
**Post date:** [October 2, 2019, 4:56am UTC](https://discuss.elastic.co/t/filter-fields-on-list-documents/201893/1 "2019-10-02T04:56:38Z")

</div>

Is it possible to filter the list of returned fields when GETting `..../documents.json`? I need a way to get a list of documents that are in the index without having to download the complete content of every document.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [October 2, 2019, 4:19pm UTC](https://discuss.elastic.co/t/filter-fields-on-list-documents/201893/2 "2019-10-02T16:19:10Z")

</div>

Hey @Sophistifunk, I unfortunately don't think that's possible.

You could probably get a smaller payload using the search endpoint with an empty query, and specifying that you only want the "id" field to be returned:

```auto
{
    "engine_key": "a4Al5UBHiDCDgqKawekA",
    "q": "",
    "fetch_fields":{
      "national-parks":["id"]
    },
    "sort_field":{"national-parks":"id"},
    "sort_direction":{"national-parks":"asc"}
}

```

---

<div class="post-metadata">

**Author:** ![Sophistifunk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sophistifunk/32/55224_2.png) [@Sophistifunk](https://discuss.elastic.co/u/Sophistifunk)\
**Post date:** [October 3, 2019, 3:04am UTC](https://discuss.elastic.co/t/filter-fields-on-list-documents/201893/3 "2019-10-03T03:04:51Z")

</div>

This appears to work, thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 31, 2019, 3:04am UTC](https://discuss.elastic.co/t/filter-fields-on-list-documents/201893/4 "2019-10-31T03:04:58Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
