Map unable to show result when filters are applied

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.


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.

Is there a way to fix this issue? Any advice will be greatly appreciated!

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? Please also link the found or created github issue here

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?

Hello @Nathan_Reese thanks for replying!
Configuration for term join
image
Configuration for control


image

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

{
  "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": []
    }
  }
}
{
  "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)

{
  "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": []
    }
  }
}
{
  "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)

{
  "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": []
    }
  }
}
{
  "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
Thank you so much for your help! Really appreciate it

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.

1 Like

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. Feel free to comment as you see fit.

Thank you @Nathan_Reese it works now!


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!

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