elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.77k stars 8.17k forks source link

When courier:ignoreFilterIfFieldNotInIndex enabled, geographic filters no longer working #153595

Closed balt311 closed 1 year ago

balt311 commented 1 year ago

Kibana version: 8.6.2

Elasticsearch version: 8.6.2

Server OS version: Windows 19

Browser version: Chrome, Edge

Browser OS version:

Original install method (e.g. download page, yum, from source, etc.): download zip windows 64bit

Describe the bug: With 2 indexes displayed/filterable on a dashboard/map, ingnoreFilterFieldNotInIndex is enabled so to filter on the different indexes. This performs well with the regular controls/filters, however, it seems to take away the ability to use geographic filters: Draw Shape to filter, etc.., on the map.

Steps to reproduce:

  1. Create a Dashboard containing a map and other charts with 2 different indexes that are mappable
  2. enable ingnoreFilterFieldNotInIndex
  3. Filter for a custom area using the 'Draw Shape to Filter' Tool in the map visualization

Expected behavior: All point locations from any of the visible indexes should be filtered on the map and other dashboard charts/visualizations

Screenshots (if relevant):

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

elasticmachine commented 1 year ago

Pinging @elastic/kibana-presentation (Team:Presentation)

balt311 commented 1 year ago

any advice on this? I would like to have two indexes on a dashboard that are filterable by geographies/shapes, but they have different fields so need to be ignored when one index is filtered by a field that the other does not have. thanks.

nreese commented 1 year ago

any advice on this? I would like to have two indexes on a dashboard that are filterable by geographies/shapes, but they have different fields so need to be ignored when one index is filtered by a field that the other does not have. thanks.

Since 7.14, geospatial filters support multiple fields from multiple indexes. If you are only generating filters from the map, then you should be able to turn off courier:ignoreFilterIfFieldNotInIndex.

balt311 commented 1 year ago

Yes, that would make it easy if filters were only generated from the map, but filters are generated mostly from controls and tables and queries. ex: data is filtered by type/category via a control and then filtered by geography using the map. With courier:ignoreFilterIfFieldNotInIndex off it works for only one of the indexes. With it on, it works for the controls/table filters but geographic filters do not get applied.

balt311 commented 1 year ago

I thought maybe it was because the point data indexes have geo_point fields called 'location' while the polygon shapes have geo_area fields called 'geometry', I thought if changing the point 'location' field to be named 'geometry' so they match but after testing this out, it doesn't seem to make a difference. geography filters do not work when Ignore Filter(s) is enabled. Can this be fixed?

nreese commented 1 year ago

Yes it can be fixed, but it will take a code fix and an upgrade.

As a work around, you could disable courier:ignoreFilterIfFieldNotInIndex to get geometry filters to function properly in current releases.

balt311 commented 1 year ago

Great! Would this be the place to request it be looked into? I'm currently using the workaround but would really need to have both indexes filterable via controls and geometry. An example of the two indexes are of citizen service requests and police crime/accident data, so the need is to mix filter analyze (different types of service requests compared to different types of accidents/crime) to find correlations/trends both in chart form and spatially.