rondog Posted December 6, 2010 Share Posted December 6, 2010 So I've full text indexed the columns I want searchable: I have some rows inserted: Yet when I run a match() against(), I get 0 results: If I do: SELECT * FROM video WHERE MATCH (name) AGAINST ('test') I get 2 results. Why does that work, yet keywords don't? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted December 6, 2010 Share Posted December 6, 2010 Most likely because, any word that is too short is ignored. The default minimum length of words that are found by full-text searches is four characters. http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html Quote Link to comment Share on other sites More sharing options...
rondog Posted December 6, 2010 Author Share Posted December 6, 2010 Most likely because, any word that is too short is ignored. The default minimum length of words that are found by full-text searches is four characters. http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html Oh, ok that is good to know. I can see you can also change that length. Thank you. Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted December 6, 2010 Share Posted December 6, 2010 Most likely because, any word that is too short is ignored. The default minimum length of words that are found by full-text searches is four characters. http://dev.mysql.com/doc/refman/5.0/en/fulltext-natural-language.html Oh, ok that is good to know. I can see you can also change that length. Thank you. Your welcome. Also keep in mind that unless you are using Boolean Full-Text Searches, that if the text you search on is in 50% or more of the rows then no results will be returned. This used to get me all the time when using test data. Quote Link to comment Share on other sites More sharing options...
rondog Posted December 6, 2010 Author Share Posted December 6, 2010 yeah I read that. Ok I got a question..if I search "ronnie"and a row contains "ronnie's", why does that not count as a valid result? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted December 6, 2010 Share Posted December 6, 2010 yeah I read that. Ok I got a question..if I search "ronnie"and a row contains "ronnie's", why does that not count as a valid result? I think because the ' is treated as a word character then ronnie doesn't match that entire word. I'm not sure of the best way to overcome that. Quote Link to comment Share on other sites More sharing options...
rondog Posted December 6, 2010 Author Share Posted December 6, 2010 yeah I read that. Ok I got a question..if I search "ronnie"and a row contains "ronnie's", why does that not count as a valid result? I think because the ' is treated as a word character then ronnie doesn't match that entire word. I'm not sure of the best way to overcome that. Well I guess that is my next hurdle Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted December 6, 2010 Share Posted December 6, 2010 Change this line in your my.cnf file under the etc folder [mysqld] ft_min_word_len = 2 You can also use in boolean mode to be more accurate like exact phrase, beginning,ending or with a word, and so on. It's the advanced search mode. The way I do it is a multiple select to mysql using get values from dropdowns to change the modes. and a search for ronnie's would actually become a search for ronnie\'s because mysql escapes the quote Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.