# ignoreFilterIfFieldNotInIndex does not work?

**URL:** <https://discuss.elastic.co/t/ignorefilteriffieldnotinindex-does-not-work/369382>\
**Category:** Kibana\
**Created:** [October 24, 2024, 6:56pm UTC](https://discuss.elastic.co/t/ignorefilteriffieldnotinindex-does-not-work/369382 "2024-10-24T18:56:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nnikushkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nnikushkin/32/122950_2.png) [@nnikushkin](https://discuss.elastic.co/u/nnikushkin)\
**Post date:** [October 24, 2024, 6:56pm UTC](https://discuss.elastic.co/t/ignorefilteriffieldnotinindex-does-not-work/369382/1 "2024-10-24T18:56:15Z")

</div>

Hi there!

I enabled "ignoreFilterIfFieldNotInIndex" option in Kibana Advanced Settings, since I am using 2 data views and I would like to avoid filtering out documents if some field does not exist in the data view

However, it did not work while I successfully used it a few years ago

I found the similar issue on Github:

> <https://github.com/elastic/kibana/issues/28784>
>
> \*\*Kibana version:\*\* \[Reported by user in 6.4\](https://discuss.elastic.co/t/does-…ignorefilteriffieldnotinindex-still-work/161544/6) and I reproduced in master, so probably everything in between as well
> 
> \*\*Describe the bug:\*\*
> 
> Enabling \`ignoreFilterIfFieldNotInIndex\` should prevent visualizations on a dashboard from being filtered if the index pattern they're based on does not contained the filtered field. This isn't happening, even with the setting enabled all visualizations are getting filtered. Oddly, it \*\*is\*\* working for Saved Searches (see screenshot).
> 
> \*\*Steps to reproduce:\*\*
> 1. Run the following in Dev Tools to setup some example indices:
> 
> \`\`\`
> PUT my\_index\_1
> {
> "settings": {
> "index": {
> "number\_of\_shards": "1",
> "number\_of\_replicas": "0"
> }
> }
> }
> 
> PUT my\_index\_2
> {
> "settings": {
> "index": {
> "number\_of\_shards": "1",
> "number\_of\_replicas": "0"
> }
> }
> }
> 
> POST my\_index\_1/\_doc
> {
> "field1": "A"
> }
> 
> POST my\_index\_1/\_doc
> {
> "field1": "B"
> }
> 
> POST my\_index\_1/\_doc
> {
> "field1": "C"
> }
> 
> POST my\_index\_2/\_doc
> {
> "field2": "A"
> }
> 
> POST my\_index\_2/\_doc
> {
> "field2": "B"
> }
> 
> POST my\_index\_2/\_doc
> {
> "field2": "C"
> }
> \`\`\`
> 
> 2. Create a dashboard with two metric visualizations with a simple Count aggregation, one for each index.
> 3. Add a filter on one of the fields, notice that both visualizations get filtered
> 4. Enable the advanced setting
> 5. Go back to dashboard and create a filter again. Notice both visualizations are still getting filtered. 
> 
> \*\*Screenshots (if relevant):\*\*
> 
> !\[screen shot 2019-01-15 at 2 59 51 pm\](https://user-images.githubusercontent.com/6239176/51206643-8a11c880-18d6-11e9-8426-e19d437fb61c.png)

however, it was for the old Kibana version

Nevertheless, the issue can be reproduced on my current 8.15.0:

**Steps to reproduce:**

1. Run the following in Dev Tools to setup some example indices:

```auto
PUT my_index_1
{
  "settings": {
    "index": {
      "number_of_shards": "1",
      "number_of_replicas": "0"
    }
  }
}

PUT my_index_2
{
  "settings": {
    "index": {
      "number_of_shards": "1",
      "number_of_replicas": "0"
    }
  }
}

POST my_index_1/_doc
{
  "field1": "A"
}

POST my_index_1/_doc
{
  "field1": "B"
}

POST my_index_1/_doc
{
  "field1": "C"
}

POST my_index_2/_doc
{
  "field2": "A"
}

POST my_index_2/_doc
{
  "field2": "B"
}

POST my_index_2/_doc
{
  "field2": "C"
}

```

1. Create a dashboard with two metric visualizations with a simple Count aggregation, one for each index.
2. Add a filter on one of the fields, notice that both visualizations get filtered
3. Enable the advanced setting
4. Go back to dashboard and create a filter again. Notice both visualizations are still getting filtered.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/b/eb10f70999e46ce621d0044cad9dece03e71d436.png)

Am I doing something wrong?

Thank you!

---

<div class="post-metadata">

**Author:** ![Teresa\_Alvarez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/teresa_alvarez/32/102490_2.png) [@Teresa\_Alvarez](https://discuss.elastic.co/u/Teresa_Alvarez)\
**Post date:** [October 25, 2024, 11:18am UTC](https://discuss.elastic.co/t/ignorefilteriffieldnotinindex-does-not-work/369382/2 "2024-10-25T11:18:35Z")

</div>

Thanks for your post @nnikushkin I can't replicate this problem, it works fine for me. Can you turn the Advanced Setting off and on again and reload the page afterwards to make sure the change is applied?

---

<div class="post-metadata">

**Author:** ![nnikushkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nnikushkin/32/122950_2.png) [@nnikushkin](https://discuss.elastic.co/u/nnikushkin)\
**Post date:** [October 25, 2024, 7:06pm UTC](https://discuss.elastic.co/t/ignorefilteriffieldnotinindex-does-not-work/369382/3 "2024-10-25T19:06:44Z")

</div>

Thank you @Teresa_Alvarez!

Hmm, indeed, when I redeployed Elastic from the scratch it started working as expected

Thank you for taking a look at it!

Have a wonderful day!
