Jump to content

help with searching


rondog

Recommended Posts

So I've full text indexed the columns I want searchable:

arms_structure.jpg

 

 

 

I have some rows inserted:

arms_rows.jpg

 

 

 

Yet when I run a match() against(), I get 0 results:

arms_result.jpg

 

 

If I do:

SELECT * FROM video WHERE MATCH (name) AGAINST ('test')

I get 2 results. Why does that work, yet keywords don't?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :D

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.