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] filter operator registry and spatial_filter operator #111897

Closed
wants to merge 11 commits into from

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Sep 10, 2021

Fixes #109340 and #107044

Background

In Maps, users can create spatial filters. The filter is added to the Filter bar.
Screen Shot 2021-09-03 at 4 07 33 PM
There are 2 important properties about spatial filters created from a Map:

  • filter.meta.type is set to spatial_filter. Maps uses filter.meta.type to identify spatial filters. Spatial filters are displayed on the map to provide a visual reference of all applied spatial filters.
  • filter.meta.isMultiIndex is set to true since Elasticsearch Query DSL for the filter is not tied to a single index pattern or field. The Elasticsearch Query DSL is generated in such a way that the filter works for all map layers, regardless of index pattern or spatial field. In the screenshot above a single filter is filtering both layers, even though they are from different index patterns and different spatial fields.
    • Each layer identifies one or more geo_point or geo_shape fields that is used to display features for that layer
    • The Elasticsearch Query DSL combines these into a bool.should clause where each field provides a bool.must clause ensuring the spatial field exists and that the document satisfies the spatial filter. Any document matching any of the bool.must clauses allows the bool.should clause to produce a match.

Test instructions

  • Install web logs sample data set and open "[Logs] Total Requests and Bytes" map
  • Click wrench and select "Draw bounds to filter data". Draw bounds and create a filter.
  • In the Filter bar, edit the filter. Notice that the filter editor opens in "values" view and not the "query DSL" view. Notice that Index pattern select, Field select, and operator select are not displayed.
    Screen Shot 2021-09-13 at 1 30 41 PM
  • Change the label and click save. The filter should still be displayed on the map.

Changes to Data plugin

  • Updates FilterEditor to handle multi index filters. When a filter is a multi index filter, the editor does not display IndexPattern select, Field select, or operator select.
  • Creates a filter operator registry so that the maps plugin can register a filter operator for spatial_filter type.
  • Migrates hard coded filter operator array to filter operator registry. This involved refactoring several places that used a switch on meta.type and moving the logic into Operator interface.
  • Updates setup contract to expose filterEditor service.

Changes to Maps plugin

  • Registers a spatialFilterOperator. Now, when editing a spatial filter, the filter editor shows "values" form instead of the "query DSL" form. This allows for changing the filter label. In the future, there will be UI showing the filter on a map and allowing users to edit the filter shape or redraw it.
  • Updates spatial filter creation to set filter.meta.isMultiIndex = true for all generated filters even if there is only a single geo field. The reason for this is that geo field names are decoupled from index patterns and there is no way of knowing if a geo field name exists on multi index patterns. In practice, any spatial filter created from the map is not coupled to field/index, thus its a multi index filter.
  • Creates a folder setup to organize files used during setup phase since public folder was getting a bit unorganized.

@nreese nreese added Feature:Filters release_note:fix [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.16.0 v8.0.0 auto-backport Deprecated - use backport:version if exact versions are needed labels Sep 13, 2021
@nreese nreese marked this pull request as ready for review September 13, 2021 19:47
@nreese nreese requested review from a team as code owners September 13, 2021 19:47
@elasticmachine
Copy link
Contributor

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

@kibanamachine
Copy link
Contributor

kibanamachine commented Sep 13, 2021

💔 Build Failed

Failed CI Steps


Test Failures

Kibana Pipeline / jest / Jest Tests.x-pack/plugins/maps/public/classes/sources/es_geo_grid_source.ESGeoGridSource getGeoJsonWithMeta Should configure the SearchSource correctly

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches


Stack Trace

Error: expect(received).toEqual(expected) // deep equality

- Expected  - 1
+ Received  + 2

@@ -1,11 +1,12 @@
  Array [
    Object {
      "meta": Object {
        "alias": null,
        "disabled": false,
-       "key": "bar",
+       "isMultiIndex": true,
+       "key": undefined,
        "negate": false,
      },
      "query": Object {
        "bool": Object {
          "must": Array [
    at Object.<anonymous> (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/x-pack/plugins/maps/public/classes/sources/es_geo_grid_source/es_geo_grid_source.test.ts:208:37)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at _callCircusTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:212:5)
    at _runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:149:3)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:63:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at _runTestsForDescribeBlock (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:57:9)
    at run (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/run.js:25:3)
    at runAndTransformResultsToJestFormat (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:176:21)
    at jestAdapter (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:109:19)
    at runTestInternal (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:380:16)
    at runTest (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/runTest.js:472:34)
    at Object.worker (/var/lib/jenkins/workspace/elastic+kibana+pipeline-pull-request/kibana/node_modules/jest-runner/build/testWorker.js:133:12)

Kibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/discover/_filter_editor·ts.discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 1 times on tracked branches: https://dryrun

[00:00:00]       │
[00:07:30]         └-: discover app
[00:07:30]           └-> "before all" hook in "discover app"
[00:07:30]           └-> "before all" hook in "discover app"
[00:21:32]           └-: discover filter editor
[00:21:32]             └-> "before all" hook in "discover filter editor"
[00:21:32]             └-> "before all" hook in "discover filter editor"
[00:21:32]               │ debg load kibana index with default index pattern
[00:21:32]               │ debg Cleaning all saved objects { space: undefined }
[00:21:32]               │ info deleting batch of 3 objects
[00:21:32]               │ succ deleted 3 objects
[00:21:32]               │ debg resolved import for test/functional/fixtures/kbn_archiver/discover.json to /dev/shm/workspace/parallel/12/kibana/test/functional/fixtures/kbn_archiver/discover.json
[00:21:32]               │ info importing 2 saved objects { space: undefined }
[00:21:33]               │ succ import success
[00:21:33]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Loading "mappings.json"
[00:21:33]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Loading "data.json.gz"
[00:21:33]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.22"
[00:21:33]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.20"
[00:21:33]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.21"
[00:21:34]               │ debg replacing kibana config doc: {"defaultIndex":"logstash-*"}
[00:21:34]               │ debg discover filter editor
[00:21:34]               │ debg navigating to discover url: http://localhost:61121/app/discover#/
[00:21:34]               │ debg navigate to: http://localhost:61121/app/discover#/
[00:21:35]               │ debg browser[INFO] http://localhost:61121/app/discover?_t=1631570520559#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:21:35]               │
[00:21:35]               │ debg browser[INFO] http://localhost:61121/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:35]               │ debg ... sleep(700) start
[00:21:35]               │ debg ... sleep(700) end
[00:21:35]               │ debg returned from get, calling refresh
[00:21:36]               │ debg browser[INFO] http://localhost:61121/app/discover?_t=1631570520559#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:21:36]               │
[00:21:36]               │ debg browser[INFO] http://localhost:61121/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:36]               │ debg currentUrl = http://localhost:61121/app/discover#/
[00:21:36]               │          appUrl = http://localhost:61121/app/discover#/
[00:21:36]               │ debg TestSubjects.find(kibanaChrome)
[00:21:36]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:21:36]               │ debg ... sleep(501) start
[00:21:37]               │ debg ... sleep(501) end
[00:21:37]               │ debg in navigateTo url = http://localhost:61121/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:21:37]               │ debg --- retry.tryForTime error: URL changed, waiting for it to settle
[00:21:37]               │ debg ... sleep(501) start
[00:21:38]               │ debg ... sleep(501) end
[00:21:38]               │ debg in navigateTo url = http://localhost:61121/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:21:38]               │ debg Setting absolute range to Sep 19, 2015 @ 06:31:44.000 to Sep 23, 2015 @ 18:31:44.000
[00:21:38]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:21:38]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=20000
[00:21:38]               │ debg TestSubjects.exists(superDatePickerShowDatesButton)
[00:21:38]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=2500
[00:21:38]               │ debg TestSubjects.click(superDatePickerShowDatesButton)
[00:21:38]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=10000
[00:21:38]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=10000
[00:21:38]               │ debg TestSubjects.exists(superDatePickerstartDatePopoverButton)
[00:21:38]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerstartDatePopoverButton"]') with timeout=2500
[00:21:38]               │ debg TestSubjects.click(superDatePickerendDatePopoverButton)
[00:21:38]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerendDatePopoverButton"]') with timeout=10000
[00:21:38]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerendDatePopoverButton"]') with timeout=10000
[00:21:38]               │ debg Find.findByCssSelector('div.euiPopover__panel-isOpen') with timeout=10000
[00:21:38]               │ debg TestSubjects.click(superDatePickerAbsoluteTab)
[00:21:38]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:38]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:38]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:38]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:38]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:38]               │ debg TestSubjects.setValue(superDatePickerAbsoluteDateInput, Sep 23, 2015 @ 18:31:44.000)
[00:21:38]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:38]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:38]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:39]               │ debg TestSubjects.click(superDatePickerstartDatePopoverButton)
[00:21:39]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerstartDatePopoverButton"]') with timeout=10000
[00:21:39]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerstartDatePopoverButton"]') with timeout=10000
[00:21:39]               │ debg Find.waitForElementStale with timeout=10000
[00:21:39]               │ debg Find.findByCssSelector('div.euiPopover__panel-isOpen') with timeout=10000
[00:21:39]               │ debg TestSubjects.click(superDatePickerAbsoluteTab)
[00:21:39]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:39]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:39]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:39]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:39]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:39]               │ debg TestSubjects.setValue(superDatePickerAbsoluteDateInput, Sep 19, 2015 @ 06:31:44.000)
[00:21:39]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:39]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:39]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:40]               │ debg Waiting up to 20000ms for Timepicker popover to close...
[00:21:40]               │ debg TestSubjects.exists(superDatePickerAbsoluteDateInput)
[00:21:40]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=2500
[00:21:40]               │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerAbsoluteDateInput"] is not displayed
[00:21:43]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:43]               │ debg TestSubjects.exists(superDatePickerApplyTimeButton)
[00:21:43]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=2500
[00:21:46]               │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerApplyTimeButton"] is not displayed
[00:21:46]               │ debg TestSubjects.click(querySubmitButton)
[00:21:46]               │ debg Find.clickByCssSelector('[data-test-subj="querySubmitButton"]') with timeout=10000
[00:21:46]               │ debg Find.findByCssSelector('[data-test-subj="querySubmitButton"]') with timeout=10000
[00:21:46]               │ debg Find.waitForElementStale with timeout=10000
[00:21:46]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:21:46]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:21:46]             └-: filter editor
[00:21:46]               └-> "before all" hook for "should add a phrases filter"
[00:21:46]               └-> should add a phrases filter
[00:21:46]                 └-> "before each" hook: global before each for "should add a phrases filter"
[00:21:46]                 │ debg TestSubjects.click(addFilter)
[00:21:46]                 │ debg Find.clickByCssSelector('[data-test-subj="addFilter"]') with timeout=10000
[00:21:46]                 │ debg Find.findByCssSelector('[data-test-subj="addFilter"]') with timeout=10000
[00:21:46]                 │ debg comboBox.set, comboBoxSelector: filterFieldSuggestionList
[00:21:46]                 │ debg TestSubjects.find(filterFieldSuggestionList)
[00:21:46]                 │ debg Find.findByCssSelector('[data-test-subj="filterFieldSuggestionList"]') with timeout=10000
[00:21:47]                 │ debg comboBox.setElement, value: extension.raw
[00:21:47]                 │ debg comboBox.isOptionSelected, value: extension.raw
[00:21:50]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:21:50]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:21:50]                 │ debg Find.allByCssSelector('.euiFilterSelectItem[title^="extension.raw"]') with timeout=2500
[00:21:50]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:21:50]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:21:53]                 │ debg --- retry.tryForTime error: [data-test-subj~="comboBoxOptionsList"] is not displayed
[00:21:53]                 │ debg comboBox.set, comboBoxSelector: filterOperatorList
[00:21:53]                 │ debg TestSubjects.find(filterOperatorList)
[00:21:53]                 │ debg Find.findByCssSelector('[data-test-subj="filterOperatorList"]') with timeout=10000
[00:21:53]                 │ debg comboBox.setElement, value: is one of
[00:21:53]                 │ debg comboBox.isOptionSelected, value: is one of
[00:21:56]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:21:56]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:21:56]                 │ debg Find.allByCssSelector('.euiFilterSelectItem[title^="is one of"]') with timeout=2500
[00:21:56]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:21:56]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:21:59]                 │ debg --- retry.tryForTime error: [data-test-subj~="comboBoxOptionsList"] is not displayed
[00:21:59]                 │ debg TestSubjects.find(filterParams)
[00:21:59]                 │ debg Find.findByCssSelector('[data-test-subj="filterParams"]') with timeout=10000
[00:21:59]                 │ debg comboBox.setElement, value: jpg
[00:21:59]                 │ debg comboBox.isOptionSelected, value: jpg
[00:22:02]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:02]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:02]                 │ debg Find.allByCssSelector('.euiFilterSelectItem[title^="jpg"]') with timeout=2500
[00:22:02]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:02]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:02]                 │ debg TestSubjects.click(saveFilter)
[00:22:02]                 │ debg Find.clickByCssSelector('[data-test-subj="saveFilter"]') with timeout=10000
[00:22:02]                 │ debg Find.findByCssSelector('[data-test-subj="saveFilter"]') with timeout=10000
[00:22:03]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:22:03]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:22:03]                 │ debg TestSubjects.exists(filter filter-enabled filter-key-extension.raw filter-value-jpg filter-unpinned)
[00:22:03]                 │ debg Find.existsByCssSelector('[data-test-subj="filter filter-enabled filter-key-extension.raw filter-value-jpg filter-unpinned"]') with timeout=2500
[00:22:03]                 └- ✓ pass  (16.3s) "discover app discover filter editor filter editor should add a phrases filter"
[00:22:03]               └-> should show the phrases if you re-open a phrases filter
[00:22:03]                 └-> "before each" hook: global before each for "should show the phrases if you re-open a phrases filter"
[00:22:03]                 │ debg TestSubjects.click(~filter & ~filter-key-extension.raw & ~filter-value-jpg)
[00:22:03]                 │ debg Find.clickByCssSelector('[data-test-subj~="filter"][data-test-subj~="filter-key-extension.raw"][data-test-subj~="filter-value-jpg"]') with timeout=10000
[00:22:03]                 │ debg Find.findByCssSelector('[data-test-subj~="filter"][data-test-subj~="filter-key-extension.raw"][data-test-subj~="filter-value-jpg"]') with timeout=10000
[00:22:03]                 │ debg TestSubjects.click(editFilter)
[00:22:03]                 │ debg Find.clickByCssSelector('[data-test-subj="editFilter"]') with timeout=10000
[00:22:03]                 │ debg Find.findByCssSelector('[data-test-subj="editFilter"]') with timeout=10000
[00:22:03]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:22:03]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:22:05]                 │ debg comboBox.getComboBoxSelectedOptions, comboBoxSelector: ~filterParamsComboBox
[00:22:05]                 │ debg TestSubjects.find(~filterParamsComboBox)
[00:22:05]                 │ debg Find.findByCssSelector('[data-test-subj~="filterParamsComboBox"]') with timeout=10000
[00:22:05]                 │ info Taking screenshot "/dev/shm/workspace/parallel/12/kibana/test/functional/screenshots/failure/discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter.png"
[00:22:05]                 │ info Current URL is: http://localhost:61121/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-19T06:31:44.000Z%27,to:%272015-09-23T18:31:44.000Z%27))&_a=(columns:!(),filters:!((%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,index:%27logstash-*%27,key:extension.raw,negate:!f,params:!(jpg),type:phrases),query:(bool:(minimum_should_match:1,should:!((match_phrase:(extension.raw:jpg))))))),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:22:05]                 │ info Saving page source to: /dev/shm/workspace/parallel/12/kibana/test/functional/failure_debug/html/discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter.html
[00:22:05]                 └- ✖ fail: discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter
[00:22:05]                 │      Error: expected 0 to equal 1
[00:22:05]                 │       at Assertion.assert (node_modules/@kbn/expect/expect.js:100:11)
[00:22:05]                 │       at Assertion.be.Assertion.equal (node_modules/@kbn/expect/expect.js:227:8)
[00:22:05]                 │       at Assertion.be (node_modules/@kbn/expect/expect.js:69:22)
[00:22:05]                 │       at Context.<anonymous> (test/functional/apps/discover/_filter_editor.ts:47:35)
[00:22:05]                 │       at runMicrotasks (<anonymous>)
[00:22:05]                 │       at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:22:05]                 │       at Object.apply (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:22:05]                 │ 
[00:22:05]                 │ 

Stack Trace

Error: expected 0 to equal 1
    at Assertion.assert (node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.be.Assertion.equal (node_modules/@kbn/expect/expect.js:227:8)
    at Assertion.be (node_modules/@kbn/expect/expect.js:69:22)
    at Context.<anonymous> (test/functional/apps/discover/_filter_editor.ts:47:35)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Object.apply (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)

Kibana Pipeline / general / Chrome UI Functional Tests.test/functional/apps/discover/_filter_editor·ts.discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:07:30]         └-: discover app
[00:07:30]           └-> "before all" hook in "discover app"
[00:07:30]           └-> "before all" hook in "discover app"
[00:21:39]           └-: discover filter editor
[00:21:39]             └-> "before all" hook in "discover filter editor"
[00:21:39]             └-> "before all" hook in "discover filter editor"
[00:21:39]               │ debg load kibana index with default index pattern
[00:21:39]               │ debg Cleaning all saved objects { space: undefined }
[00:21:39]               │ info deleting batch of 3 objects
[00:21:40]               │ succ deleted 3 objects
[00:21:40]               │ debg resolved import for test/functional/fixtures/kbn_archiver/discover.json to /dev/shm/workspace/parallel/12/kibana/test/functional/fixtures/kbn_archiver/discover.json
[00:21:40]               │ info importing 2 saved objects { space: undefined }
[00:21:41]               │ succ import success
[00:21:41]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Loading "mappings.json"
[00:21:41]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Loading "data.json.gz"
[00:21:41]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.22"
[00:21:41]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.20"
[00:21:41]               │ info [test/functional/fixtures/es_archiver/logstash_functional] Skipped restore for existing index "logstash-2015.09.21"
[00:21:42]               │ debg replacing kibana config doc: {"defaultIndex":"logstash-*"}
[00:21:43]               │ debg discover filter editor
[00:21:43]               │ debg navigating to discover url: http://localhost:61121/app/discover#/
[00:21:43]               │ debg navigate to: http://localhost:61121/app/discover#/
[00:21:43]               │ debg browser[INFO] http://localhost:61121/app/discover?_t=1631569125644#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:21:43]               │
[00:21:43]               │ debg browser[INFO] http://localhost:61121/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:43]               │ debg ... sleep(700) start
[00:21:44]               │ debg ... sleep(700) end
[00:21:44]               │ debg returned from get, calling refresh
[00:21:45]               │ debg browser[INFO] http://localhost:61121/app/discover?_t=1631569125644#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:21:45]               │
[00:21:45]               │ debg browser[INFO] http://localhost:61121/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:21:45]               │ debg currentUrl = http://localhost:61121/app/discover#/
[00:21:45]               │          appUrl = http://localhost:61121/app/discover#/
[00:21:45]               │ debg TestSubjects.find(kibanaChrome)
[00:21:45]               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:21:45]               │ debg ... sleep(501) start
[00:21:46]               │ debg ... sleep(501) end
[00:21:46]               │ debg in navigateTo url = http://localhost:61121/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:21:46]               │ debg --- retry.tryForTime error: URL changed, waiting for it to settle
[00:21:46]               │ debg ... sleep(501) start
[00:21:47]               │ debg ... sleep(501) end
[00:21:47]               │ debg in navigateTo url = http://localhost:61121/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))&_a=(columns:!(),filters:!(),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:21:47]               │ debg Setting absolute range to Sep 19, 2015 @ 06:31:44.000 to Sep 23, 2015 @ 18:31:44.000
[00:21:47]               │ debg TestSubjects.exists(superDatePickerToggleQuickMenuButton)
[00:21:47]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerToggleQuickMenuButton"]') with timeout=20000
[00:21:47]               │ debg TestSubjects.exists(superDatePickerShowDatesButton)
[00:21:47]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=2500
[00:21:47]               │ debg TestSubjects.click(superDatePickerShowDatesButton)
[00:21:47]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=10000
[00:21:47]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerShowDatesButton"]') with timeout=10000
[00:21:47]               │ debg TestSubjects.exists(superDatePickerstartDatePopoverButton)
[00:21:47]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerstartDatePopoverButton"]') with timeout=2500
[00:21:47]               │ debg TestSubjects.click(superDatePickerendDatePopoverButton)
[00:21:47]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerendDatePopoverButton"]') with timeout=10000
[00:21:47]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerendDatePopoverButton"]') with timeout=10000
[00:21:47]               │ debg Find.findByCssSelector('div.euiPopover__panel-isOpen') with timeout=10000
[00:21:47]               │ debg TestSubjects.click(superDatePickerAbsoluteTab)
[00:21:47]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:47]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:47]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:47]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:47]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:47]               │ debg TestSubjects.setValue(superDatePickerAbsoluteDateInput, Sep 23, 2015 @ 18:31:44.000)
[00:21:47]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:47]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:47]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:48]               │ debg TestSubjects.click(superDatePickerstartDatePopoverButton)
[00:21:48]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerstartDatePopoverButton"]') with timeout=10000
[00:21:48]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerstartDatePopoverButton"]') with timeout=10000
[00:21:48]               │ debg Find.waitForElementStale with timeout=10000
[00:21:48]               │ debg Find.findByCssSelector('div.euiPopover__panel-isOpen') with timeout=10000
[00:21:48]               │ debg TestSubjects.click(superDatePickerAbsoluteTab)
[00:21:48]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:48]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteTab"]') with timeout=10000
[00:21:48]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:48]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:48]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:48]               │ debg TestSubjects.setValue(superDatePickerAbsoluteDateInput, Sep 19, 2015 @ 06:31:44.000)
[00:21:48]               │ debg TestSubjects.click(superDatePickerAbsoluteDateInput)
[00:21:48]               │ debg Find.clickByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:48]               │ debg Find.findByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=10000
[00:21:49]               │ debg Waiting up to 20000ms for Timepicker popover to close...
[00:21:49]               │ debg TestSubjects.exists(superDatePickerAbsoluteDateInput)
[00:21:49]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerAbsoluteDateInput"]') with timeout=2500
[00:21:49]               │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerAbsoluteDateInput"] is not displayed
[00:21:52]               │ debg --- retry.tryForTime failed again with the same message...
[00:21:52]               │ debg TestSubjects.exists(superDatePickerApplyTimeButton)
[00:21:52]               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="superDatePickerApplyTimeButton"]') with timeout=2500
[00:21:55]               │ debg --- retry.tryForTime error: [data-test-subj="superDatePickerApplyTimeButton"] is not displayed
[00:21:55]               │ debg TestSubjects.click(querySubmitButton)
[00:21:55]               │ debg Find.clickByCssSelector('[data-test-subj="querySubmitButton"]') with timeout=10000
[00:21:55]               │ debg Find.findByCssSelector('[data-test-subj="querySubmitButton"]') with timeout=10000
[00:21:55]               │ debg Find.waitForElementStale with timeout=10000
[00:21:56]               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:21:56]               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:21:56]             └-: filter editor
[00:21:56]               └-> "before all" hook for "should add a phrases filter"
[00:21:56]               └-> should add a phrases filter
[00:21:56]                 └-> "before each" hook: global before each for "should add a phrases filter"
[00:21:56]                 │ debg TestSubjects.click(addFilter)
[00:21:56]                 │ debg Find.clickByCssSelector('[data-test-subj="addFilter"]') with timeout=10000
[00:21:56]                 │ debg Find.findByCssSelector('[data-test-subj="addFilter"]') with timeout=10000
[00:21:56]                 │ debg comboBox.set, comboBoxSelector: filterFieldSuggestionList
[00:21:56]                 │ debg TestSubjects.find(filterFieldSuggestionList)
[00:21:56]                 │ debg Find.findByCssSelector('[data-test-subj="filterFieldSuggestionList"]') with timeout=10000
[00:21:56]                 │ debg comboBox.setElement, value: extension.raw
[00:21:56]                 │ debg comboBox.isOptionSelected, value: extension.raw
[00:21:59]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:21:59]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:21:59]                 │ debg Find.allByCssSelector('.euiFilterSelectItem[title^="extension.raw"]') with timeout=2500
[00:22:00]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:00]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:02]                 │ debg --- retry.tryForTime error: [data-test-subj~="comboBoxOptionsList"] is not displayed
[00:22:03]                 │ debg comboBox.set, comboBoxSelector: filterOperatorList
[00:22:03]                 │ debg TestSubjects.find(filterOperatorList)
[00:22:03]                 │ debg Find.findByCssSelector('[data-test-subj="filterOperatorList"]') with timeout=10000
[00:22:03]                 │ debg comboBox.setElement, value: is one of
[00:22:03]                 │ debg comboBox.isOptionSelected, value: is one of
[00:22:05]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:05]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:05]                 │ debg Find.allByCssSelector('.euiFilterSelectItem[title^="is one of"]') with timeout=2500
[00:22:06]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:06]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:08]                 │ debg --- retry.tryForTime error: [data-test-subj~="comboBoxOptionsList"] is not displayed
[00:22:09]                 │ debg TestSubjects.find(filterParams)
[00:22:09]                 │ debg Find.findByCssSelector('[data-test-subj="filterParams"]') with timeout=10000
[00:22:09]                 │ debg comboBox.setElement, value: jpg
[00:22:09]                 │ debg comboBox.isOptionSelected, value: jpg
[00:22:11]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:11]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:11]                 │ debg Find.allByCssSelector('.euiFilterSelectItem[title^="jpg"]') with timeout=2500
[00:22:12]                 │ debg TestSubjects.exists(~comboBoxOptionsList)
[00:22:12]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj~="comboBoxOptionsList"]') with timeout=2500
[00:22:12]                 │ debg TestSubjects.click(saveFilter)
[00:22:12]                 │ debg Find.clickByCssSelector('[data-test-subj="saveFilter"]') with timeout=10000
[00:22:12]                 │ debg Find.findByCssSelector('[data-test-subj="saveFilter"]') with timeout=10000
[00:22:12]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:22:12]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:22:12]                 │ debg TestSubjects.exists(filter filter-enabled filter-key-extension.raw filter-value-jpg filter-unpinned)
[00:22:12]                 │ debg Find.existsByCssSelector('[data-test-subj="filter filter-enabled filter-key-extension.raw filter-value-jpg filter-unpinned"]') with timeout=2500
[00:22:12]                 └- ✓ pass  (16.8s) "discover app discover filter editor filter editor should add a phrases filter"
[00:22:12]               └-> should show the phrases if you re-open a phrases filter
[00:22:12]                 └-> "before each" hook: global before each for "should show the phrases if you re-open a phrases filter"
[00:22:12]                 │ debg TestSubjects.click(~filter & ~filter-key-extension.raw & ~filter-value-jpg)
[00:22:12]                 │ debg Find.clickByCssSelector('[data-test-subj~="filter"][data-test-subj~="filter-key-extension.raw"][data-test-subj~="filter-value-jpg"]') with timeout=10000
[00:22:12]                 │ debg Find.findByCssSelector('[data-test-subj~="filter"][data-test-subj~="filter-key-extension.raw"][data-test-subj~="filter-value-jpg"]') with timeout=10000
[00:22:13]                 │ debg TestSubjects.click(editFilter)
[00:22:13]                 │ debg Find.clickByCssSelector('[data-test-subj="editFilter"]') with timeout=10000
[00:22:13]                 │ debg Find.findByCssSelector('[data-test-subj="editFilter"]') with timeout=10000
[00:22:13]                 │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:22:13]                 │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:22:15]                 │ debg comboBox.getComboBoxSelectedOptions, comboBoxSelector: ~filterParamsComboBox
[00:22:15]                 │ debg TestSubjects.find(~filterParamsComboBox)
[00:22:15]                 │ debg Find.findByCssSelector('[data-test-subj~="filterParamsComboBox"]') with timeout=10000
[00:22:15]                 │ info Taking screenshot "/dev/shm/workspace/parallel/12/kibana/test/functional/screenshots/failure/discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter.png"
[00:22:15]                 │ info Current URL is: http://localhost:61121/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:%272015-09-19T06:31:44.000Z%27,to:%272015-09-23T18:31:44.000Z%27))&_a=(columns:!(),filters:!((%27$state%27:(store:appState),meta:(alias:!n,disabled:!f,index:%27logstash-*%27,key:extension.raw,negate:!f,params:!(jpg),type:phrases),query:(bool:(minimum_should_match:1,should:!((match_phrase:(extension.raw:jpg))))))),index:%27logstash-*%27,interval:auto,query:(language:kuery,query:%27%27),sort:!(!(%27@timestamp%27,desc)))
[00:22:15]                 │ info Saving page source to: /dev/shm/workspace/parallel/12/kibana/test/functional/failure_debug/html/discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter.html
[00:22:15]                 └- ✖ fail: discover app discover filter editor filter editor should show the phrases if you re-open a phrases filter
[00:22:15]                 │      Error: expected 0 to equal 1
[00:22:15]                 │       at Assertion.assert (node_modules/@kbn/expect/expect.js:100:11)
[00:22:15]                 │       at Assertion.be.Assertion.equal (node_modules/@kbn/expect/expect.js:227:8)
[00:22:15]                 │       at Assertion.be (node_modules/@kbn/expect/expect.js:69:22)
[00:22:15]                 │       at Context.<anonymous> (test/functional/apps/discover/_filter_editor.ts:47:35)
[00:22:15]                 │       at runMicrotasks (<anonymous>)
[00:22:15]                 │       at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:22:15]                 │       at Object.apply (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:22:15]                 │ 
[00:22:15]                 │ 

Stack Trace

Error: expected 0 to equal 1
    at Assertion.assert (node_modules/@kbn/expect/expect.js:100:11)
    at Assertion.be.Assertion.equal (node_modules/@kbn/expect/expect.js:227:8)
    at Assertion.be (node_modules/@kbn/expect/expect.js:69:22)
    at Context.<anonymous> (test/functional/apps/discover/_filter_editor.ts:47:35)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at Object.apply (node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)

and 1 more failures, only showing the first 3.

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
data 573 574 +1
maps 846 847 +1
total +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
data 2738 2739 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
data 168.3KB 175.0KB +6.7KB
maps 3.2MB 3.1MB -64.5KB
total -57.8KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
data 50 51 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff errors
data 777.9KB 799.4KB +21.5KB
maps 80.7KB 147.5KB +66.8KB ❌ 59.6KB over limit
total +88.3KB
Unknown metric groups

API count

id before after diff
data 3099 3100 +1

async chunk count

id before after diff
data 10 9 -1

References to deprecated APIs

id before after diff
maps 1173 1193 +20

History

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

@nreese
Copy link
Contributor Author

nreese commented Mar 17, 2022

Closing, out of date and priorities have shifted

@nreese nreese closed this Mar 17, 2022
@nreese nreese mentioned this pull request Nov 21, 2022
1 task
nreese added a commit that referenced this pull request Apr 4, 2023
…filter disappear from map (#154087)

Fixes #107044 and
#109340

### Background
In Maps, users can [create spatial
filters](https://www.elastic.co/guide/en/kibana/current/maps-create-filter-from-map.html).
The filter is added to the Filter bar.
<img width="300" alt="Screen Shot 2021-09-03 at 4 07 33 PM"
src="https://user-images.githubusercontent.com/373691/133142628-9b03dec2-69ee-4c7c-ac8d-841168c88a94.png">
There are 2 important properties about spatial filters created from a
Map:
* `filter.meta.type` is set to `spatial_filter`. Maps uses
`filter.meta.type` to identify spatial filters. Spatial filters are
displayed on the map to provide a visual reference of all applied
spatial filters.
* `filter.meta.isMultiIndex` is set to true since Elasticsearch Query
DSL for the filter is not tied to a single index pattern or field. The
Elasticsearch Query DSL is generated in such a way that the filter works
for all map layers, regardless of index pattern or spatial field. In the
screenshot above a single filter is filtering both layers, even though
they are from different index patterns and different spatial fields.
* Each layer identifies one or more geo_point or geo_shape fields that
is used to display features for that layer
* The Elasticsearch Query DSL combines these into a `bool.should` clause
where each field provides a `bool.must` clause ensuring the spatial
field exists and that the document satisfies the spatial filter. Any
document matching any of the `bool.must` clauses allows the bool.should
clause to produce a match.

### Solution

[Earlier solution](#111897)
proposed Sept 2021. This original effort was abandoned as priorities
shifted. I investigated re-opening original solution, which included a
filter operator registry. This solution is no longer appropriate with
`combined` filters.

Instead, this PR takes a less complex approach and when
`filter.meta.isMultiIndex`, the filter editor displays the following:
* Only displays "custom" editor. "Values" editor is not available
* "Edit as filter values" toggle button is not visible
* Data view select is not visible
* onSubmit does not change filter to "custom" unless DSL is edited

<img width="500" alt="Screen Shot 2023-03-30 at 10 33 58 AM"
src="https://user-images.githubusercontent.com/373691/228918145-61ddda8b-43a3-44e8-8316-a803473f5a36.png">

### Test instructions
* Install web logs sample data set and open "[Logs] Total Requests and
Bytes" map
* Click wrench and select "Draw bounds to filter data". Draw bounds and
create a filter.
* In the Filter bar, Click "Edit filter". 
* Change the label and click save. The filter should still be displayed
on the map and the filter pill should have a new label.


<strike>Note for testing, until
#153816 is merged, spatial filters
with a single geofield will not set `isMultiIndex` to true and will
still have the errors referenced in the issues. Once
#153816 is merged all spatial
filters will set isMultiIndex.</strike>

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation Feature:Filters release_note:fix v8.1.0
Projects
None yet
3 participants