Skip to content

[Terms] Allow multiple regex patterns into include/exclude #88532

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

Closed
stratoula opened this issue Jul 14, 2022 · 4 comments
Closed

[Terms] Allow multiple regex patterns into include/exclude #88532

stratoula opened this issue Jul 14, 2022 · 4 comments
Labels
:Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@stratoula
Copy link

Description

When you want to use the include/exclude filtering feature on the terms aggregation you can either give an array of strings (exact match) or a regex pattern as a string.

This means that:

  • Passing the pattern as an array doesn't work
  • User can't have something like ['J.*', 'E.*', term1, term2] (a combination of terms and regexes)

We want to support this feature in Lens. In order to help the users understand how this works we are introducing a UI like this
image

The user can start selecting terms from a multi-select dropdown or open the switch and add a regex. We thing that it would be more powerful if we could combine exact matches and patterns.

@stratoula stratoula added >enhancement :Analytics/Aggregations Aggregations needs:triage Requires assignment of a team area label labels Jul 14, 2022
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 14, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

@pugnascotia pugnascotia removed the needs:triage Requires assignment of a team area label label Jul 14, 2022
@not-napoleon
Copy link
Member

I think you can just compose a multi-branch regular expression to get this behavior? something like ([JE].*)|term1|term2 should do exactly what you describe. That said, it is possible to add this feature on the server side, although it does require us to do some careful thinking about the precedence rules. What use cases would that enable?

This was last discussed two years ago on #63325

@stratoula
Copy link
Author

I see, I missed that on the documentation tbh. I think we can work like that. I am closing it :)

@Aassifh
Copy link

Aassifh commented Dec 2, 2022

Multi branch regex has its down sides in terms of perfomance issues, i hope that we can have the combination of both (regex and exact match array) some day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Aggregations Aggregations >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

5 participants