question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support "any" filters at top level

See original GitHub issue

Use case: Searching for “parks” which are in “California” OR are “World Heritage Sites”

This is currently not possible. The following actions:

addFilter("states", "California", "any")
addFilter("states", "Alaska", "any")
addFilter("world_heritage_site", "true", "any")

Would result in the query:

"filters": {
    "all": [
      {
        "any": [
          { "states": "California" },
          { "states": "Alaska" }
        ]
      },
      {
        "any": [
          { "world_heritage_site": "true" }
        ]
      }
    ]
  }

Currently, the “any” parameter affects the relation of a filter to other filters on the same field, NOT the relation to other fields, which is that top level “all”.

We could provide a second parameter to choose “all” or “any” at the top level:

addFilter("states", "California", "any", "any")
addFilter("states", "Alaska", "any",  "any")
addFilter("world_heritage_site", "true", "any")
"filters": {
    "any": [
      {
        "any": [
          { "states": "California" },
          { "states": "Alaska" }
        ]
      },
      {
        "any": [
          { "world_heritage_site": "true" }
        ]
      }
    ]
  }

A real world use case for this:

Like while checking package delivery availability one person might want to see if the delivery is available at Office Address OR Home Address

There could be other solutions for this, but this is my current proposal.

In the meantime, users can work around this bye programatically changing the outbound API request: https://github.com/elastic/search-ui/blob/master/ADVANCED.md#api-config

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:17 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
JasonStoltzcommented, Aug 13, 2020

Hey! Would love to help you out, not sure how soon we can get to this, unfortunately.

0reactions
DickyKwokcommented, Aug 4, 2020

As mentioned above, How can we work on it by programatically changing the outbound API request to support or fileter (https://github.com/elastic/search-ui/blob/master/ADVANCED.md#api-config)? I am desperate for this feature, can somebody save my world?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add a filter to a report in Power BI - Microsoft Learn
Open the Visualizations, Filters, and Fields panes, if they're not already open. Visualizations, Filters, and Fields panes.
Read more >
Matrix Filtering by (Rolled up) Top Level Value
Solved: Hi All, I have a dataset which contains project stage values and these roll-up to the project and total in a matrix...
Read more >
Filter Ad Manager report results - Google Help
When you create a report, you can narrow down your report results by advertiser, order, key-value, and more with filters. Some dimension filters...
Read more >
Filters and Level of Detail Expressions - Tableau Help
If you then put [State] on the Filters shelf to hide some of the states, the filter will affect only the numerator in...
Read more >
Filtering data transferred by AWS DataSync
All filters are relative to the source location path. ... To exclude folders at the top level of the source location, you can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found