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

Searching for messages with special characters #1440

Open
jhwheeler opened this issue Jan 21, 2025 · 0 comments
Open

Searching for messages with special characters #1440

jhwheeler opened this issue Jan 21, 2025 · 0 comments

Comments

@jhwheeler
Copy link

jhwheeler commented Jan 21, 2025

Problem

We're looking for guidance on searching messages with special characters, i.e. non-alphanumeric characters. We've tried several approaches, including some post-processing techniques and conditional query composition, but haven't found a consistent method.

Test Cases We've Attempted

  1. Searching for a message that is solely comprised of non-alphanumeric characters, for example ???:
{ text: { $q: "???" } } // ❌ no matches
{ text: { $autocomplete: "???" } } // ❌ no matches
{ text: { $eq: "???" } } // ✅ match

$q and $autocomplete return 0 results. While $eq does return the message, if we do a partial search, e.g. ? or ??, then of course $eq won't match, and $q and $autocomplete have the same behavior of returning 0 results.

This occurs for all of the non-alphanumeric character that we have tested: ~!@#$%^&*()_+-={}|[]\:;"'<>?,./.

  1. Searching for a message that contains both alphanumerics and non-alphanumerics, for example "foo bar" or "hello":

$q seems to work only if the query runs up against a word boundary:

  • Searching for "foo bar":
    • "f, "fo: ❌ no matches
    • "foo: ✅ match
  • Searching for "hello":
    • "h, "he, "hel, "hell: ❌ no matches
    • "hello, "hello": ✅ match

$autocomplete does not have this issue; all of the above will match.

Request

Can you provide some guidance as to how we can solve this? Using $autocomplete does solve the second issue, but not the first one (searching for messages that are only comprised of non-alphanumeric characters). This reduces usability and causes apparent bugs for our end users when they are searching for messages such as ?, !, ?!?!, and the like.

Thank you!

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

1 participant