MySQL  Full Text Search questions

Posted on 2009-02-16
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.

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.

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?

 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'.  

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?
Question by:zenguru
    1 Comment
    LVL 39

    Accepted Solution

    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:


    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:

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
    Video by: Tony
    This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now