# How to exclude a specific field in multi get query globally for all docs?

**URL:** <https://discuss.elastic.co/t/how-to-exclude-a-specific-field-in-multi-get-query-globally-for-all-docs/288919>\
**Category:** Elasticsearch\
**Created:** [November 10, 2021, 6:21pm UTC](https://discuss.elastic.co/t/how-to-exclude-a-specific-field-in-multi-get-query-globally-for-all-docs/288919 "2021-11-10T18:21:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cholley\_Alexandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cholley_alexandre/32/90867_2.png) [@Cholley\_Alexandre](https://discuss.elastic.co/u/Cholley_Alexandre)\
**Post date:** [November 10, 2021, 6:21pm UTC](https://discuss.elastic.co/t/how-to-exclude-a-specific-field-in-multi-get-query-globally-for-all-docs/288919/1 "2021-11-10T18:21:11Z")

</div>

Hi, I'm trying to exclude a specific field in a multi-get query, but not by specifying \_source ou \_source\_excludes in each doc but globally for all docs, how is it possible? Thank u in advance for your help 😉

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [November 10, 2021, 7:09pm UTC](https://discuss.elastic.co/t/how-to-exclude-a-specific-field-in-multi-get-query-globally-for-all-docs/288919/2 "2021-11-10T19:09:11Z")

</div>

I think you can use \_source\_excludes query parameter instead of \_source\_exclude in request body. The former is a query parameter and applied to all docs in the query. See [Multi get (mget) API | Elasticsearch Guide [7.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html).

---

<div class="post-metadata">

**Author:** ![Cholley\_Alexandre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cholley_alexandre/32/90867_2.png) [@Cholley\_Alexandre](https://discuss.elastic.co/u/Cholley_Alexandre)\
**Post date:** [November 10, 2021, 8:05pm UTC](https://discuss.elastic.co/t/how-to-exclude-a-specific-field-in-multi-get-query-globally-for-all-docs/288919/3 "2021-11-10T20:05:03Z")

</div>

Hi Tomo\_M, thank you for your reply. It works perfectly. I didn't think it was possible to combine query parameters and body parameters. If it can help other people, here's my sample query :

```auto
GET /my_index/_mget?_source_excludes=my_excluded_field_name
{
"ids": ["my_first_id", "my_second_id","my_third_id"]
}

```

---

<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:** [December 8, 2021, 8:05pm UTC](https://discuss.elastic.co/t/how-to-exclude-a-specific-field-in-multi-get-query-globally-for-all-docs/288919/4 "2021-12-08T20:05:36Z")

</div>

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