{"id":273,"date":"2008-02-13T20:06:30","date_gmt":"2008-02-13T19:06:30","guid":{"rendered":"http:\/\/www.nivas.hr\/blog\/2008\/02\/13\/mysql-doesnt-like-me-beware-of-mysql-stopwords\/"},"modified":"2008-02-13T20:08:19","modified_gmt":"2008-02-13T19:08:19","slug":"mysql-doesnt-like-me-beware-of-mysql-stopwords","status":"publish","type":"post","link":"https:\/\/www.nivas.hr\/blog\/2008\/02\/13\/mysql-doesnt-like-me-beware-of-mysql-stopwords\/","title":{"rendered":"mysql doesn&#8217;t like me! beware of mysql stopwords&#8230;"},"content":{"rendered":"<p>Today we spent few hours debugging search for friends functionality on one of our new projects. To make story short, we had one really <a href=\"http:\/\/dev.mysql.com\/tech-resources\/articles\/full-text-revealed.html\">complex fulltext search query<\/a>. Interestingly enough, I was searching for my self (seven) in database, and I was unable to find ANY reference to user seven.<\/p>\n<p>Empty set (31 ms):<br \/>\n<code>SELECT * FROM t WHERE MATCH (name_nick ) AGAINST ('seven*' IN BOOLEAN MODE);<\/code><\/p>\n<p>1 rows fetched (47 ms):<br \/>\n<code>SELECT a FROM t WHERE name_nick like '%seven%';<\/code><\/p>\n<p>1 rows fetched (47 ms):<br \/>\n<code>SELECT * FROM t WHERE name_nick RLIKE '[[:<:]]seven[[:>:]]';<\/code><\/p>\n<p>Be hold! MySQL <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.0\/en\/fulltext-stopwords.html\">Full-Text Stopwords<\/a>. <\/p>\n<p>You can get over this, by modifying mysql stopwords and recompiling from source (myisam\/ft_static.c holds them), but I would rather not do that for now. We had to use fulltext search because like was just too damn slow for 5000+ users.<\/p>\n<p>There is chance that this problem is to be fixed in future and it&#8217;s been tracked as initiative to <a href=\"http:\/\/forge.mysql.com\/worklog\/task.php?id=2573\">remove Natural Language Full-Text Search limitations from boolean mode<\/a>. Until then, if you want to be my friend&#8230; search for Neven! :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we spent few hours debugging search for friends functionality on one of our new projects. To make story short, we had one really complex fulltext search query. Interestingly enough, I was searching for my self (seven) in database, and I was unable to find ANY reference to user seven. Empty set (31 ms): SELECT&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/273"}],"collection":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/comments?post=273"}],"version-history":[{"count":0,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/posts\/273\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/media?parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/categories?post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nivas.hr\/blog\/wp-json\/wp\/v2\/tags?post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}