1

I'm looking for a way to add additional word separators for MySQL5.7's full text search. Basically would like to tell mysql to consider underscores as comas. Would turning underscores into stopwords work? And how? Any info appreciated.

Edit: the solution proposed here is no solution and does not explore stopwords.

Community
  • 1
  • 1
Eric
  • 9,870
  • 14
  • 66
  • 102
  • Possible duplicate of [How to make MySQL treat underscore as a word separator for fulltext search?](http://stackoverflow.com/questions/2251518/how-to-make-mysql-treat-underscore-as-a-word-separator-for-fulltext-search) – CodeCaster Jan 23 '17 at 17:03
  • That referenced post does not bring any solution, nor explores stopwords. – Eric Jan 23 '17 at 17:04
  • Perhaps you couldn't be bothered to scroll down, but the non-accepted answer does show a solution: create a copy of the character map in use and mark `_` as a non-word character. – CodeCaster Jan 23 '17 at 17:11
  • That post is talking about adding the dash character, not the underscore character, which is an exception for the stopword list. – Eric Jan 23 '17 at 17:15
  • Yeah so it's the reverse of what you want. The dash character is a separator by default, which they didn't want. The underscore character is a word character by default, which you don't want. – CodeCaster Jan 23 '17 at 17:17
  • Except you can't add underscore, that's the big issue. – Eric Jan 23 '17 at 17:19
  • @Eric did you ever find a solution to this? It would be helpful for me to accomplish the same – Symphony0084 May 28 '20 at 16:45
  • @willsmanley unfortunatelly no – Eric May 28 '20 at 17:15
  • ok thanks. for anyone else coming upon this, I think the best option is to create a duplicative column - replacing underscores with spaces, or similar. And that one can have the full text index. – Symphony0084 May 29 '20 at 02:56
  • @willsmanley I think we ended up changing underscore with dash... – Eric May 29 '20 at 12:54

0 Answers0