Solved

MySQL MATCH query for part words

Posted on 2010-11-17
3
447 Views
Last Modified: 2012-05-10
Hi team,

I am trying to find all the records which include the word intervention or an extension thereon.

SELECT
provider1_providers.provider_name,
provider1_providers.`profile`,
provider1_providers.services_information,
provider1_providers.other_information
FROM
provider1_providers
where
MATCH(other_information) AGAINST('Intervention' WITH QUERY EXPANSION)

I have a Fulltext index set and all records with 'Intervention' appear, but records with 'Interventions' do not appear.

What do I need to add for this?

All help is appreciated
Cheers Bernard
0
Comment
Question by:BernardGBailey
3 Comments
 
LVL 3

Expert Comment

by:boraganesh
ID: 34161474
pls try following
SELECT
provider1_providers.provider_name,
provider1_providers.`profile`,
provider1_providers.services_information,
provider1_providers.other_information
FROM
provider1_providers
where
other_information like %Intervention%

Open in new window

0
 
LVL 4

Accepted Solution

by:
Romi Kuntsman earned 500 total points
ID: 34161897
"LIKE" doesn't use FullText indexing.
You need to use Match as you do.
http://dev.mysql.com/doc/refman/5.1/en/fulltext-search.html

But you need Boolean search, not Query Expansion
http://dev.mysql.com/doc/refman/5.0/en/fulltext-boolean.html

So try:
MATCH(other_information) AGAINST('Intervention*' IN BOOLEAN MODE)
0
 

Author Closing Comment

by:BernardGBailey
ID: 34162503
Thanks for the heads up
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Email Header Detail 12 63
SQL Syntax: How to force case sensitive query? 2 44
Filtering characters in an SQL field 2 16
Stored Proc - Rewrite 42 56
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

792 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