Unable to search for a string that validly contains a hyphen

Summary
Unable to search for a string that validly contains a hyphen.

Steps to reproduce
Mattermost: 10.5.11

  1. Send a message anywhere with a hyphen, for example, the task number TICKET-1337.
  2. Enter TICKET-1337 in the search.

Expected behavior
I see my message in the search results.

Observed behavior
Nothing found

I know that the hyphen is an exclusion character (as described here Search for messages - Mattermost documentation ). But either some kind of escaping mechanism is needed. Or consider the hyphen as an occurrence for exclusion only when preceded by a space, i.e., TICKET-1337 is searched simply as a raw string, and then TICKET -1337 (with space between) is recognized as an exclusion for 1337.

1 Like

Terms containing a dash return incorrect results since dashes are ignored in the search engine.

From your linked docs: seems like the above is the root cause :thinking:

That’s probably it. Unfortunately, it causes a lot of inconvenience, as the use case is far from uncommon, in my opinion.

I hope I can bring attention to this.