Mattermost-server: Search terms with hyphen using DB engine should work

Created on 30 Apr 2020  路  5Comments  路  Source: mattermost/mattermost-server

Right now we're removing the hyphens in the search and replacing them with whitespace but if we enclose the search term, for example, t-shirt with quotes it works.

We should fix this and allow to search for words with hyphen like t-shirt for example

This problem affects both databases and the solution might be different for each one of them


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-24529

AreDB Medium Help Wanted PR Exists TecGo

Most helpful comment

I can take this one!

All 5 comments

I can take this one!

@amyblais I'm trying to understand what's the expected outcome.
Say we have two posts:
1). t shirt
2). t-shirt

Right now, if I search for t-shirt it will return both posts.
The expected behaviour would be that if I search for t-shirt it should ONLY return post 1)?

@ethervoid ^

@fedealconada yes, that's the expected outcome. If your search for t-shirt your should get just one result.

In this case, to test the fix you're proposing you can also add a new test case here that searches for both terms, one with hyphens and another without it, and see if only one result is returned

Was this page helpful?
0 / 5 - 0 ratings