# Map unable to show result when filters are applied

**URL:** <https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625>\
**Category:** Kibana\
**Created:** [December 1, 2021, 5:26am UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625 "2021-12-01T05:26:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arrick](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arrick](https://discuss.elastic.co/u/Arrick)\
**Post date:** [December 1, 2021, 5:26am UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/1 "2021-12-01T05:26:37Z")

</div>

Hello, I just started using Kibana not long ago and encounter some problems. For my current dataset, I do not have any map geo data but only country names. So I had to do a terms join method with an external map geo data provided by elastic. My map manage to display data accurately.

 ![map](https://us1.discourse-cdn.com/elastic/original/3X/3/3/333d512db517dd5616a86d4f8f63dff3972ed2f8.png)  
However, when I try to filter my data using the control panel at the right side of the image, my map does not show any results. For this case I tried to filter based on English language but my map does not reflect the data.  
 ![map](https://us1.discourse-cdn.com/elastic/original/3X/5/3/534f9cef2a238e5d9e9accb295c872f5e84de68d.png)  
Is there a way to fix this issue? Any advice will be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![monfera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/monfera/32/26467_2.png) [@monfera](https://discuss.elastic.co/u/monfera)\
**Post date:** [December 13, 2021, 11:43am UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/2 "2021-12-13T11:43:49Z")

</div>

Hi Arrick, I'll run it by my colleagues, in the meantime if you believe it's a bug, can you please search for a duplicate report an if one doesn't exist, file a bug report in the [Kibana repo](https://github.com/elastic/kibana/issues)? Please also link the found or created github issue here

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [December 13, 2021, 2:15pm UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/3 "2021-12-13T14:15:03Z")

</div>

Can you share how your term join is configured and how your control is configured? You can debug this by opening the inspector for the map panel. What is the request and response for the term join?

---

<div class="post-metadata">

**Author:** ![Arrick](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arrick](https://discuss.elastic.co/u/Arrick)\
**Post date:** [December 14, 2021, 7:37am UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/4 "2021-12-14T07:37:24Z")

</div>

Hello @Nathan_Reese thanks for replying!  
Configuration for term join  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/2/f2e70d9a37add772ed3fcc76003846ce7815aaf3.png)  
Configuration for control

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/f/4fd30d0dd90507c353e12103eafa85c12e12e557.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/7/77c6e7673f374d7207dc429f8e8fae05c94a18e5.png)

Request & response when **no filter** is introduced  
**For Geo (Elastic geo map data)**

```auto
{
  "docvalue_fields": [],
  "size": 10000,
  "track_total_hits": 10001,
  "_source": [
    "coordinates",
    "name"
  ],
  "sort": [
    {
      "name.keyword": {
        "order": "asc",
        "unmapped_type": "boolean"
      }
    }
  ],
  "script_fields": {},
  "stored_fields": [
    "coordinates",
    "name"
  ],
  "runtime_mappings": {},
  "query": {
    "bool": {
      "must": [],
      "filter": [],
      "should": [],
      "must_not": []
    }
  }
}

```

```auto
{
  "id": "FndZNkFRZVJYVHlPZFB0clpLcEJfZUEcenlfQmtMTk9TZUMwc2c0ZC1sZzB4UTo2OTM2Nw==",
  "rawResponse": {
    "took": 1111,
    "timed_out": false,
    "_shards": {
      "total": 1,
      "successful": 1,
      "skipped": 0,
      "failed": 0
    },
    "hits": {
      "total": {
        "value": 250,
        "relation": "eq"
      },
      "max_score": null,
      "hits": [
        {
          "_index": "geo",
          "_type": "_doc",
          "_id": "gFO-A30BXh0EoPEHqbvL",
          "_score": null,
          "_source": {
            "coordinates": {
              "coordinates": [
                [
                  [
                    [
                      20.278023,
                      60.142064
                    ],
                    .
                    .
                    .
                  [
                    67.780591,
                    37.188672
                  ]
                ]
              ],
              "type": "Polygon"
            },
            "name": "Afghanistan"
          },
          "sort": [
            "Afghanistan"
          ]
        }
      ]
    }
  },
  "isPartial": false,
  "isRunning": false,
  "total": 1,
  "loaded": 1,
  "isRestored": true
}

```

Request & response when **no filter** is introduced  
**For Article country(my dataset)**

```auto
{
  "size": 0,
  "track_total_hits": false,
  "aggs": {
    "join": {
      "terms": {
        "size": 65535,
        "field": "documentMessage.documents.document.countries.country.keyword"
      },
      "aggs": {}
    }
  },
  "fields": [
    {
      "field": "documentMessage.documents.document.captureDatetime",
      "format": "date_time"
    },
    {
      "field": "documentMessage.documents.document.reportDatetime",
      "format": "date_time"
    },
    {
      "field": "documentMessage.documents.document.translation.translatedDatetime",
      "format": "date_time"
    }
  ],
  "script_fields": {},
  "stored_fields": [
    "*"
  ],
  "runtime_mappings": {
    "newDate": {
      "type": "keyword",
      "script": {
        "source": "ZonedDateTime input = doc['documentMessage.documents.document.reportDatetime'].value;\r\nString output = input.format(DateTimeFormatter.ISO_LOCAL_DATE);\r\nemit(output)"
      }
    }
  },
  "_source": {
    "excludes": []
  },
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "range": {
            "documentMessage.documents.document.reportDatetime": {
              "format": "strict_date_optional_time",
              "gte": "2008-11-01T00:57:51.566Z",
              "lte": "2031-12-14T07:21:55.810Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

```

```auto
{
  "id": "FlM3YlhlSjcxUTFhZGt1Q2Z6R3ZJMGccenlfQmtMTk9TZUMwc2c0ZC1sZzB4UTo2OTQ0OQ==",
  "rawResponse": {
    "took": 2,
    "timed_out": false,
    "_shards": {
      "total": 1,
      "successful": 1,
      "skipped": 0,
      "failed": 0
    },
    "hits": {
      "max_score": null,
      "hits": []
    },
    "aggregations": {
      "join": {
        "doc_count_error_upper_bound": 0,
        "sum_other_doc_count": 0,
        "buckets": [
          {
            "key": "Jakarta",
            "doc_count": 779
          },
          {
            "key": "JAKARTA",
            "doc_count": 364
          },
           .
           .
           .
           {
            "key": "加帛",
            "doc_count": 1
          },
          {
            "key": "马鲁帝",
            "doc_count": 1
          }
        ]
      }
    }
  },
  "isPartial": false,
  "isRunning": false,
  "total": 1,
  "loaded": 1,
  "isRestored": false
}

```

Request & response when **english language filter** is introduced  
**For Geo(Elastic map geo data)**

```auto
{
  "docvalue_fields": [],
  "size": 10000,
  "track_total_hits": 10001,
  "_source": [
    "coordinates",
    "name"
  ],
  "sort": [
    {
      "name.keyword": {
        "order": "asc",
        "unmapped_type": "boolean"
      }
    }
  ],
  "script_fields": {},
  "stored_fields": [
    "coordinates",
    "name"
  ],
  "runtime_mappings": {},
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "match_phrase": {
            "documentMessage.documents.document.contentLanguage.keyword": "en"
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

```

```auto
{
  "id": "FkRwMFY5al9SUzdxT2NUeWx4cnVmdHccenlfQmtMTk9TZUMwc2c0ZC1sZzB4UTo3MjY1MQ==",
  "rawResponse": {
    "took": 0,
    "timed_out": false,
    "_shards": {
      "total": 1,
      "successful": 1,
      "skipped": 0,
      "failed": 0
    },
    "hits": {
      "total": {
        "value": 0,
        "relation": "eq"
      },
      "max_score": null,
      "hits": []
    }
  },
  "isPartial": false,
  "isRunning": false,
  "total": 1,
  "loaded": 1,
  "isRestored": false
}

```

Request & response when **english language filter** is introduced  
**For Article(my dataset)**  
It is the exact same as without filter.  
I can send another reply with it attached if needed.

I'm guessing the issue is that they are trying to match with the string 'en'? But even so, how do I avoid this issue?  
`"match_phrase": { "documentMessage.documents.document.contentLanguage.keyword": "en"`

I downloaded the geo data (world countries layer) from: [Elastic Maps Service](https://maps.elastic.co/#file/world_countries)  
Thank you so much for your help! Really appreciate it

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [December 14, 2021, 4:34pm UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/5 "2021-12-14T16:34:53Z")

</div>

Thanks for all the information. The problem is that the filter from the control is getting applied to the left side of the term join. The left side is the one providing the vector features of the world countries. The left side does not have the field `documentMessage.documents.document.contentLanguage.keyword` so no vector features are getting returned.

To resolve the issue, ~~uncheck "Apply global filter to join" in the Term join configuration.~~ Uncheck "Apply global filter to layer data" in the "Filtering" configuration. That way, the control filter will only be applied to the right side of the term join and not the left side.

---

<div class="post-metadata">

**Author:** ![Nathan\_Reese](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nathan_reese/32/84829_2.png) [@Nathan\_Reese](https://discuss.elastic.co/u/Nathan_Reese)\
**Post date:** [December 14, 2021, 5:30pm UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/6 "2021-12-14T17:30:25Z")

</div>

I have created an issue to discuss better ways to avoid this problem, [[Maps] prevent users from filtering left-side of joins when filtering right side · Issue #121210 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/121210). Feel free to comment as you see fit.

---

<div class="post-metadata">

**Author:** ![Arrick](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Arrick](https://discuss.elastic.co/u/Arrick)\
**Post date:** [December 15, 2021, 4:25am UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/7 "2021-12-15T04:25:13Z")

</div>

Thank you @Nathan_Reese it works now!

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/1/d1ac53ae10590bfbf2355b4505224eb463a15471.png)  
My maps filter accordingly to my selected date, there's some data lacking for my content language therefore, my map is unable to generate for other language other than English but it works with my date control filter!

---

<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:** [January 12, 2022, 4:25am UTC](https://discuss.elastic.co/t/map-unable-to-show-result-when-filters-are-applied/290625/8 "2022-01-12T04:25:53Z")

</div>

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