# Query to list all \_ignored field values

**URL:** https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312
**Category:** Elasticsearch
**Created:** [April 26, 2024, 6:55pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312 "2024-04-26T18:55:20Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_Raguero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_raguero/32/133901_2.png) [@Alex\_Raguero](https://discuss.elastic.co/u/Alex_Raguero)
#### Post date: [April 26, 2024, 6:55pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312/1 "2024-04-26T18:55:20Z")

</div>

I am running ES version 7.10. What is the query to get all docs where \_ignored field exists and lists the value?

---

<div class="post-metadata">

### Author: ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)
#### Post date: [April 26, 2024, 8:13pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312/2 "2024-04-26T20:13:12Z")

</div>

Hi @Alex_Raguero

This doc help you: [\_ignored field | Elasticsearch Guide [8.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-ignored-field.html)

---

<div class="post-metadata">

### Author: ![Alex\_Raguero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_raguero/32/133901_2.png) [@Alex\_Raguero](https://discuss.elastic.co/u/Alex_Raguero)
#### Post date: [April 26, 2024, 8:51pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312/3 "2024-04-26T20:51:56Z")

</div>

Hi, I wasn't sure what to put as my source so it returns the \_ignored value:

```auto
GET _search
{
  "query": {
    "exists": {
      "field": "_ignored"
    }
  }
  "source": "???"
}

```

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [April 26, 2024, 10:25pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312/4 "2024-04-26T22:25:55Z")

</div>

> [@Alex\_Raguero](#):
>
> Hi, I wasn't sure what to put as my source so it returns the \_ignored value

You need to run a query to get all the documents where the `_ignored` field exists.

For example, the following query will query your indices and return the documents where the `_ignored` field exists.

```auto
GET */_search
{
  "query": {
    "exists": {
      "field": "_ignored"
    }
  },
  "_source": false
}

```

You will get something like this as an answer:

```auto
{
  "took": 4,
  "timed_out": false,
  "_shards": {
    "total": 4,
    "successful": 4,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "index-name",
        "_id": "document-id",
        "_score": 1,
        "_ignored": [
          "field.name"
        ]
      }
    ]
  }
}

```

The `field.name` is the **name** of the field that was ignored during indexing, to get its value you would need to return the entire document or filter the return by this field, but since you may not always no the name of the field being ignored you may need to return the entire document.

To return the entire document just use this:

```auto
GET */_search
{
  "query": {
    "exists": {
      "field": "_ignored"
    }
  }
}

```

To filter by the ignored field just use:

```auto
{
  "query": {
    "exists": {
      "field": "_ignored"
    }
  },
  "fields": [
    "field.name"
  ],
  "_source": false
}

```

---

<div class="post-metadata">

### Author: ![Alex\_Raguero](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_raguero/32/133901_2.png) [@Alex\_Raguero](https://discuss.elastic.co/u/Alex_Raguero)
#### Post date: [April 26, 2024, 11:05pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312/5 "2024-04-26T23:05:23Z")

</div>

Thank you!

---

<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: [May 24, 2024, 11:05pm UTC](https://discuss.elastic.co/t/query-to-list-all-ignored-field-values/358312/6 "2024-05-24T23:05:51Z")

</div>

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