MySQL Stop Words and Logical Full Text

I am using mysql built into logical full-text functions to find a dataset. (MATCH ... AGAINST syntax).

I am having a problem where keywords in the default list in MySql do not return any results. For example, "earlier", "between", etc.

There is (I think) that there is no way to disable MySql stop words at run time. And since I host my site on a shared server (DreamHost), I have no way to recompile MySQL with stopwatch disabled.

I am wondering if anyone has any suggestions regarding how to solve this problem? (No upgrade to VPS or dedicated system)

Thanks in advance for your help,

Travis

+4
source share
2 answers

I had this problem and through this post a google search query appeared (after a year). I am also on a shared host and pull my hair over the stop words set in mysql. I found a workaround that works great for me, hope this can be useful to others as well.

You can also use the REGEXP command to match the search query in your table.

SELECT * FROM table WHERE column REGEXP 'searchterm'

How do I implement this by first creating MATCH AGAINST syntax, if count = 0, I do REGEXP , instead providing my users with more results. Better than no results due to stop words and minimum length.

+2
source

Forget it, a reboot will be required to change the full-text value of mysql
details - http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

note that the dynamic column is marked NO for ft_stopword_file

However, it is not harmful to check with your hosting provider ...

If it reboots for you, you can use the following to restore the full text of the table

 mysql> REPAIR TABLE tbl_name QUICK; 
0
source

Source: https://habr.com/ru/post/1337721/


All Articles