We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

MySQL  Full Text Search questions

zenguru
zenguru asked
on
Medium Priority
815 Views
Last Modified: 2013-11-11
I have a simple table in database called  devtop with sample rows like:

id          keyphrase                                                  score
34        popular nursing schools                               q2
35        career paths in psychology                          q7

where id is the primary key.

(1)
I want to make keyphrase column as Full Text Search index type.  I could not find in the MySQL Admin GUI application how to do that.  Can you provide SQL for that ? I was able to convert from InnoDb to MyISAM which is required for Full Text Search indexing.

(2)
It says Full Text Search will ignore words shorter than 4 characters by default. But I need to search based on 3 characters words also.  How to change this default?

(3)
 Supposed I need to search for 'nurse'  ( returning rows that has the keyword nurse in the column keyphrase.  Will this return row number 34? I mean is it smart enough to know that 'nursing' also matches 'nurse'.  

(4)
What about matching synonyms? Will search for keyword ' famous'  return row 34?  As famous is synonym for popular.

Question number 5 is optional but would appreciate if you have Hibernate experience.
(5)  What is the Hibernate HQL query to search for keyword 'nurse' in the column 'keyphrase' based on Full Text Search. In Raw SQL for MYSQL I will use  Match Against construct in the SQL. What is the Hibernate HQL or Hibernate Criteria query equivalent for this?
Comment
Watch Question

Top Expert 2008
Commented:
1) alter  table TableName add fulltext index (keyphrase);

2) In mysql config file (my.ini) in mysqld section, add this and then restart the server:

ft_min_word_len=3

NB: Do this before you create the the fulltext index, or you must rebuild the index after this change is implemented.

3) No

4) No

5) I don't know

MySQL documentation can be found here:

http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.