views:

15

answers:

1

Hi there,

I have a MySQL table containing event data.

On this table, I have a FULLTEXT index, incorporating event_title,event_summary,event_details of types varchar,text,text respectively.

Examples of titles include: "Connections Count", "First Aid", "Health & Safety".

I can search the table as follows:

SELECT * FROM events WHERE MATCH (event_title,event_summary,event_details) AGAINST ('connections');

Which returns the events named "Connections Count" no problem.

However, no matter what I try, I get an empty result set when running the following queries:

SELECT * FROM events WHERE MATCH (event_title,event_summary,event_details) AGAINST ('first aid');

SELECT * FROM events WHERE MATCH (event_title,event_summary,event_details) AGAINST ('first');

SELECT * FROM events WHERE MATCH (event_title,event_summary,event_details) AGAINST ('aid');

I tried renaming an event to "Rich Aid" and could search for that just fine. Also, "First Rich" works great too.

Any ideas of why this is happening or how to fix it would be great!

Thanks for your time.

Rich

+1  A: 

"first" is a "stopword" and by default words below 4 caracters are not matched unless you specify ft_min_word_len value.

MatTheCat
Aha! I was looking a similar reserved words list which 'first' wasn't included on.Surely there is a way to search for "First Aid" using this Query though?
Rich
It seemed wrong ^^ Just edit storage/myisam/ft_static.c to change it.
MatTheCat
Change "storage/myisam/ft_static.c" (don't know if you read previous post)
MatTheCat
Brilliant, thanks :)
Rich
Shared hosting though; so will have to ask them to do it!
Rich