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

[Discover][ES|QL] Clicking and creating a filter doesnt work correctly for multivalues fields #193015

Open
stratoula opened this issue Sep 16, 2024 · 8 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Feature:ES|QL ES|QL related features in Kibana impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) Team:ESQL ES|QL related features in Kibana

Comments

@stratoula
Copy link
Contributor

stratoula commented Sep 16, 2024

Kibana version:
8.15+

Describe the bug:

It creates the wheer clause:

| WHERE `category`==Men's Accessories,Men's Clothing

which is invalid

You can replicate by clicking the table cell for the category

Image

The correct filter is

| WHERE `category`== "Men's Accessories" AND `category`== "Men's Clothing" 

My main concern for this is that I am not sure how easy is to detect that a field is a multivalue one

@stratoula stratoula added the bug Fixes for quality problems that affect the customer experience label Sep 16, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 16, 2024
@stratoula stratoula added impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana labels Sep 16, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Sep 16, 2024
@stratoula stratoula added Feature:Discover Discover Application Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) labels Sep 16, 2024
@elasticmachine
Copy link
Contributor

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

@davismcphee
Copy link
Contributor

My main concern for this is that I am not sure how easy is to detect that a field is a multivalue one

@stratoula would it work to just check if the field value is an array, or does that oversimplify it?

@stratoula
Copy link
Contributor Author

We will see 😄

@stratoula
Copy link
Contributor Author

I looked into it and:

FROM kibana_sample_data_ecommerce | WHERE `category.keyword`=="Women's Clothing" AND `category.keyword`=="Women's Shoes"

this won't return the document with the array value: [Women's Accessories, Women's Clothing]
because multivalue filtering is not supported yet from ES side.

I think for now we should not allow the filtering for multivalue fields

@stratoula
Copy link
Contributor Author

stratoula commented Sep 19, 2024

I can make the appendWhereClauseToESQLQuery to return undefined for multivalue fields.

This means that:

  • clicking a chart will not create a filter

Image

  • Clicking the cell filter actions will not create a filter

We could make it smarter and hide the cell actions in case of multivalues but @davismcphee I am not super familiar with this piece of code and from a quick glance is not straight forward. I will open a PR with the behavior described above and you can follow up if you wish

Most possibly this behavior will be supported from full text search (QSTR function) which is going to be on snapshot releases quite soon so hopefully in 8.17 will be on GA and we could use it here.

stratoula added a commit that referenced this issue Sep 25, 2024
## Summary

Part of #193015

It not allows the creation of where clause filters in case of multi
value fields as this is not supported yet in ES|QL. Check my comment
here
#193015 (comment)

It might be possible with full text search but I need to talk to the
team first. For now we disable it as it creates a wrong filter.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Davis McPhee <[email protected]>
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Sep 25, 2024
)

## Summary

Part of elastic#193015

It not allows the creation of where clause filters in case of multi
value fields as this is not supported yet in ES|QL. Check my comment
here
elastic#193015 (comment)

It might be possible with full text search but I need to talk to the
team first. For now we disable it as it creates a wrong filter.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Davis McPhee <[email protected]>
(cherry picked from commit 2492981)
kibanamachine added a commit that referenced this issue Sep 25, 2024
…) (#193962)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Disable the filter actions for multivalue fields
(#193415)](#193415)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-25T10:14:34Z","message":"[ES|QL]
Disable the filter actions for multivalue fields (#193415)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/193015\r\n\r\nIt not allows the
creation of where clause filters in case of multi\r\nvalue fields as
this is not supported yet in ES|QL. Check my
comment\r\nhere\r\nhttps://github.com//issues/193015#issuecomment-2360704651\r\n\r\nIt
might be possible with full text search but I need to talk to
the\r\nteam first. For now we disable it as it creates a wrong
filter.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Davis McPhee
<[email protected]>","sha":"249298166fe1499b4aea501056a2291711427c5b","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"[ES|QL]
Disable the filter actions for multivalue
fields","number":193415,"url":"https://github.com/elastic/kibana/pull/193415","mergeCommit":{"message":"[ES|QL]
Disable the filter actions for multivalue fields (#193415)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/193015\r\n\r\nIt not allows the
creation of where clause filters in case of multi\r\nvalue fields as
this is not supported yet in ES|QL. Check my
comment\r\nhere\r\nhttps://github.com//issues/193015#issuecomment-2360704651\r\n\r\nIt
might be possible with full text search but I need to talk to
the\r\nteam first. For now we disable it as it creates a wrong
filter.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Davis McPhee
<[email protected]>","sha":"249298166fe1499b4aea501056a2291711427c5b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193415","number":193415,"mergeCommit":{"message":"[ES|QL]
Disable the filter actions for multivalue fields (#193415)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/193015\r\n\r\nIt not allows the
creation of where clause filters in case of multi\r\nvalue fields as
this is not supported yet in ES|QL. Check my
comment\r\nhere\r\nhttps://github.com//issues/193015#issuecomment-2360704651\r\n\r\nIt
might be possible with full text search but I need to talk to
the\r\nteam first. For now we disable it as it creates a wrong
filter.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Davis McPhee
<[email protected]>","sha":"249298166fe1499b4aea501056a2291711427c5b"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Stratoula Kalafateli <[email protected]>
@kertal kertal added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Sep 26, 2024
@drewdaemon
Copy link
Contributor

drewdaemon commented Sep 27, 2024

Wouldn't ... | WHERE field IN ["Women's Accessories", "Women's Clothing"] work?

Edit: Never mind I see now that you want an and

@stratoula
Copy link
Contributor Author

Also the query above fails :)

davismcphee added a commit that referenced this issue Sep 27, 2024
…Viewer (#194232)

## Summary

This PR disables ES|QL multivalue filtering in Unified Doc Viewer,
similar to what we did for Unified Data Table in #193415:

![image](https://github.com/user-attachments/assets/f86c3ba9-05e9-4245-97f6-a8f9413950e9)

Part of #193015.

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Sep 27, 2024
…Viewer (elastic#194232)

## Summary

This PR disables ES|QL multivalue filtering in Unified Doc Viewer,
similar to what we did for Unified Data Table in elastic#193415:

![image](https://github.com/user-attachments/assets/f86c3ba9-05e9-4245-97f6-a8f9413950e9)

Part of elastic#193015.

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit 6f01d6a)
angorayc pushed a commit to angorayc/kibana that referenced this issue Oct 1, 2024
…Viewer (elastic#194232)

## Summary

This PR disables ES|QL multivalue filtering in Unified Doc Viewer,
similar to what we did for Unified Data Table in elastic#193415:

![image](https://github.com/user-attachments/assets/f86c3ba9-05e9-4245-97f6-a8f9413950e9)

Part of elastic#193015.

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
neptunian pushed a commit to neptunian/kibana that referenced this issue Oct 1, 2024
…ic#193415) (elastic#193962)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Disable the filter actions for multivalue fields
(elastic#193415)](elastic#193415)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-25T10:14:34Z","message":"[ES|QL]
Disable the filter actions for multivalue fields (elastic#193415)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/193015\r\n\r\nIt not allows the
creation of where clause filters in case of multi\r\nvalue fields as
this is not supported yet in ES|QL. Check my
comment\r\nhere\r\nhttps://github.com/elastic/issues/193015#issuecomment-2360704651\r\n\r\nIt
might be possible with full text search but I need to talk to
the\r\nteam first. For now we disable it as it creates a wrong
filter.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Davis McPhee
<[email protected]>","sha":"249298166fe1499b4aea501056a2291711427c5b","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL","v8.16.0"],"title":"[ES|QL]
Disable the filter actions for multivalue
fields","number":193415,"url":"https://github.com/elastic/kibana/pull/193415","mergeCommit":{"message":"[ES|QL]
Disable the filter actions for multivalue fields (elastic#193415)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/193015\r\n\r\nIt not allows the
creation of where clause filters in case of multi\r\nvalue fields as
this is not supported yet in ES|QL. Check my
comment\r\nhere\r\nhttps://github.com/elastic/issues/193015#issuecomment-2360704651\r\n\r\nIt
might be possible with full text search but I need to talk to
the\r\nteam first. For now we disable it as it creates a wrong
filter.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Davis McPhee
<[email protected]>","sha":"249298166fe1499b4aea501056a2291711427c5b"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193415","number":193415,"mergeCommit":{"message":"[ES|QL]
Disable the filter actions for multivalue fields (elastic#193415)\n\n##
Summary\r\n\r\nPart of
https://github.com/elastic/kibana/issues/193015\r\n\r\nIt not allows the
creation of where clause filters in case of multi\r\nvalue fields as
this is not supported yet in ES|QL. Check my
comment\r\nhere\r\nhttps://github.com/elastic/issues/193015#issuecomment-2360704651\r\n\r\nIt
might be possible with full text search but I need to talk to
the\r\nteam first. For now we disable it as it creates a wrong
filter.\r\n\r\n### Checklist\r\n\r\n- [ ] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<[email protected]>\r\nCo-authored-by:
Davis McPhee
<[email protected]>","sha":"249298166fe1499b4aea501056a2291711427c5b"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Stratoula Kalafateli <[email protected]>
seanrathier pushed a commit to seanrathier/kibana that referenced this issue Oct 2, 2024
…Viewer (elastic#194232)

## Summary

This PR disables ES|QL multivalue filtering in Unified Doc Viewer,
similar to what we did for Unified Data Table in elastic#193415:

![image](https://github.com/user-attachments/assets/f86c3ba9-05e9-4245-97f6-a8f9413950e9)

Part of elastic#193015.

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Discover Discover Application Feature:ES|QL ES|QL related features in Kibana impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) Team:ESQL ES|QL related features in Kibana
Projects
None yet
Development

No branches or pull requests

5 participants