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

[Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex when ignoreFilterIfFieldNotInIndex is true #56692

Merged
merged 5 commits into from
Feb 10, 2020

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Feb 3, 2020

Fixes #56651

When ignoreFilterIfFieldNotInIndex is true, queries are removed from the search if the index does not contain the field, https://github.com/elastic/kibana/blob/master/src/plugins/data/common/es_query/es_query/filter_matches_index.ts.

The filtering logic looks for filter.meta.key to equal one of the field names in the index. The problem was that spatial filters created by the maps application was not setting key to be the geoFieldName. Instead, key was getting set to the top level property like geo_bounding_box or geo_polygon or geo_shape. This PR updates the creation of the spatial filter so that key is set to the geo field name so the mapper does not have to pull it out of the filter where the geoFieldName context has been lost.

@nreese nreese added release_note:fix [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 v7.7.0 v7.6.0 labels Feb 3, 2020
@nreese nreese requested review from a team as code owners February 3, 2020 21:47
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm from Maps side

@nreese
Copy link
Contributor Author

nreese commented Feb 4, 2020

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Feb 4, 2020

@elasticmachine merge upstream

@nreese
Copy link
Contributor Author

nreese commented Feb 9, 2020

@elasticmachine merge upstream

Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't pulled down, but change to pass in the key looks ok to me

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit 212f1b1 into elastic:master Feb 10, 2020
nreese added a commit to nreese/kibana that referenced this pull request Feb 10, 2020
…hesIndex when ignoreFilterIfFieldNotInIndex is true (elastic#56692)

* [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex

* remove unused variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
nreese added a commit to nreese/kibana that referenced this pull request Feb 10, 2020
…hesIndex when ignoreFilterIfFieldNotInIndex is true (elastic#56692)

* [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex

* remove unused variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Feb 10, 2020
…hesIndex when ignoreFilterIfFieldNotInIndex is true (#56692) (#57249)

* [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex

* remove unused variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 11, 2020
* master: (34 commits)
  [Index management] Server-side NP ready (elastic#56829)
  Webhook action - make user and password secrets optional (elastic#56823)
  [DOCS] Removes reference to IRC (elastic#57245)
  [Monitoring] NP migration: Local angular module (elastic#51823)
  [SIEM] Adds ECS link to help menu (elastic#57104)
  Ensure http interceptors are shares across lifecycle methods (elastic#57150)
  [Remote clusters] Migrate server code out of legacy (elastic#56781)
  fixes render bug in alert list (elastic#57152)
  siem 7.6 updates (elastic#57169)
  Make the update alert API key API work when AAD is out of sync (elastic#56640)
  fix(NA): MaxListenersExceededWarning on getLoggerStream (elastic#57133)
  [Metrics UI] Setup commonly used time ranges in timepicker (elastic#56701)
  [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex when ignoreFilterIfFieldNotInIndex is true (elastic#56692)
  Create plugin mock for event log plugin (elastic#57048)
  fix ts error on master (elastic#57236)
  Don't create API key for disabled alerts when calling create API (elastic#57041)
  Fix enable and disable API to still work when AAD is out of sync (elastic#56634)
  [DOCS] Canvas embed objects (elastic#57156)
  Delete autocomplete namespace (elastic#57187)
  Security - Inject logout url (elastic#57201)
  ...
nreese added a commit that referenced this pull request Feb 12, 2020
…hesIndex when ignoreFilterIfFieldNotInIndex is true (#56692) (#57250)

* [Maps] set filter.meta.key to geoFieldName so query passes filterMatchesIndex

* remove unused variable

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Maps] Spatial filtering (Draw to filter data) doesn't work when ignoreFilterIfFieldNotInIndex is True
5 participants