Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filters] Support geospatial fields #67905

Closed
Tracked by #154870
AlonaNadler opened this issue Jun 1, 2020 · 12 comments
Closed
Tracked by #154870

[Filters] Support geospatial fields #67905

AlonaNadler opened this issue Jun 1, 2020 · 12 comments
Labels
enhancement New value added to drive a business result Feature:Filters Feature:Maps Feature:Search Querying infrastructure in Kibana impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:x-large Extra Large Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas usability

Comments

@AlonaNadler
Copy link

AlonaNadler commented Jun 1, 2020

Describe the feature:

Elasticsearch supports geo-bounding box, geo-distance, geo-polygon, and geo-shape. It would be nice if we could use these types of filters from the filter bar.

Original notes:

The customer would like to be able to filter on the existence of a geoip fields.

image

On 7.x versions, it seems greyed out.

@AlonaNadler AlonaNadler added the [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation label Jun 1, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch (Team:AppArch)

@nreese
Copy link
Contributor

nreese commented Jun 2, 2020

@elastic/kibana-app-arch

Exists filtering is disabled for geo_point and geo_shape fields even though exists query is supported in Elasticsearch.

The button is disabled because of the snippet below. How can we turn on filtering for geo_point and geo_shape type?

https://github.com/elastic/kibana/blob/7.8/src/plugins/discover/public/components/table/table_row.tsx#L82

<DocViewTableRowBtnFilterExists
  disabled={!fieldMapping || !fieldMapping.filterable}
  onClick={() => onFilter('_exists_', field, '+')}
  scripted={fieldMapping && fieldMapping.scripted}
/>

@kmartastic
Copy link
Contributor

@nreese did you ever hear back from @elastic/kibana-app-arch on this?

@lizozom
Copy link
Contributor

lizozom commented Aug 17, 2020

Enabling geo filtering from discover is as easy as adding filterable to the GEO_POINT type in src/plugins/data/common/kbn_field_types/kbn_field_types_factory.ts.

However, this adds it to the FilterBar which currently doesn't have any UI for editing geo-filters.

I think that given mocks for how geo filter editing should look like, it shouldn't be too hard to implement. (But there are some edge cases there - for example ES doesn't support topleft=bottomright, so we'd have to increase the filter window by some margin, or how do we handle one of filtering).

@nreese do you think some of the UI components from Maps could be reused here?

@nreese
Copy link
Contributor

nreese commented Aug 17, 2020

Enabling geo filtering from discover is as easy as adding filterable to the GEO_POINT type in src/plugins/data/common/kbn_field_types/kbn_field_types_factory.ts.

Are there any other side-effects of enabling filtering for geo_point and geo_shape types?

do you think some of the UI components from Maps could be reused here?

geo_point and geo_shape filters are created from drawing bounding boxes, polygons, or circles on a map. I do not think these could be reused in the filter pill editor unless the filter pill editor displayed a small map to show the filter's location.

@lizozom
Copy link
Contributor

lizozom commented Aug 17, 2020

I think you have kind of answered the question yourself: If you allow adding filters from discover, you need to support editing \ displaying them in the filter bar 🤷‍♀️ , which is not trivial.

I guess we could fallback to just showing the DSL?

@nreese
Copy link
Contributor

nreese commented Aug 17, 2020

I think this is the crux of the issue. How do you enable the exists button as described by the issue without turning on filtering for geo_point and geo_shape fields in the filter pill?

@lizozom
Copy link
Contributor

lizozom commented Aug 17, 2020

You could say that the only operator supported by this field is exists (This is controlled by adding a fieldTypes array to the exists operator in src/plugins/data/public/ui/filter_bar/filter_editor/lib/filter_operators.ts).

Then when you enable the filterable option, it should behave correctly (might require some minor adjustments in discover).

However, for some reason, the isOneOfOperator and the isNotOneOfOperator also list geo_point and geo_shape as supported field types, so those will be added too, bringing us back to square one.

Bottom line, I think we need to solve the geo filters UI (even if it's just showin the DSL), rather than try allowing only the exists filter.

@streamich streamich added enhancement New value added to drive a business result Feature:Filters impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels May 4, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort and removed impact:needs-assessment Product and/or Engineering needs to evaluate the impact of the change. labels Jun 2, 2021
@lukasolson lukasolson changed the title Support geoip in filters Support geospatial fields in filters Feb 24, 2022
@lukasolson lukasolson changed the title Support geospatial fields in filters [Filters] Support geospatial fields Feb 24, 2022
@exalate-issue-sync exalate-issue-sync bot added loe:x-large Extra Large Level of Effort and removed loe:small Small Level of Effort labels Apr 6, 2022
@jb1b84 jb1b84 added Feature:Maps Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas labels Nov 3, 2022
@elasticmachine
Copy link
Contributor

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

@jb1b84 jb1b84 removed the [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation label Nov 3, 2022
@petrklapka petrklapka added Feature:Search Querying infrastructure in Kibana Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. and removed Team:AppServicesSv labels Nov 23, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@ThomThomson
Copy link
Contributor

ThomThomson commented Jun 1, 2023

Adding this to the Maps Icebox. While this is a needed enhancement, the extra-large size, complexities around implementing a filtering registry, adding geo shapes to the existing filter pills mean that we will be unable to get to this in the near term.

An alternative / more feasible approach to this would see us creating a geospatial control with shape editing in a popover.

@ThomThomson ThomThomson closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:Filters Feature:Maps Feature:Search Querying infrastructure in Kibana impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:x-large Extra Large Level of Effort Team:DataDiscovery Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas usability
Projects
None yet
Development

No branches or pull requests

10 participants