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

Search filter with special characters #2265

Closed
alebian opened this issue Sep 20, 2022 · 2 comments
Closed

Search filter with special characters #2265

alebian opened this issue Sep 20, 2022 · 2 comments

Comments

@alebian
Copy link

alebian commented Sep 20, 2022

Hi everyone!

  • What would you like to be able to do? Can you provide some examples?

If I store some special characters in a column and want to use a filter to search, the search term is not included because of the regexp here. For example in my project I have defined a filter called sender and an email field that I want to search. If I search sender:test it works but then when I do it like sender:[email protected] it does not. Debugging a little I found that line causing the issue.

  • How could we go about implementing that?

Changing the regexp to allow more symbols like @ and .: /^#{filter}:[\w|@|\.]*$/

  • Can you think of other approaches to the problem?

It can be simplified as valid_filters&.any? { |filter| word.starts_with?("#{filter}:") }

If you think this approach is fine I can make a PR for it. I monkey patched that class with the first version and its the code I'm currently using.

Regards,
Alejandro

@pablobm
Copy link
Collaborator

pablobm commented Sep 29, 2022

Thank you for bringing this up 🙂 Something similar (not exactly the same thing) was raised at #2228, but it appears to have gone dormant. If you create PR, I'll be happy to review it.

@pablobm
Copy link
Collaborator

pablobm commented Oct 13, 2022

I think we can close this after #2260 🙂

@pablobm pablobm closed this as completed Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants