I'm using a boolean query to perform an exact match on musicians within a text 
field. However, if the musician's name contains a quote, I get inaccurate 
results. For example, this query works fine:

select * from feeds where MATCH(feed_title, feed_content) AGAINST('"Tom Petty"' 
IN BOOLEAN MODE) order by feed_date DESC

The above query returns all feeds referencing the phrase "Tom Petty". I run 
into a problem when the musician has quotes in their name:

select * from feeds where MATCH(feed_title, feed_content) AGAINST('"Sean \"P. 
Diddy\" Combs"' IN BOOLEAN MODE) order by feed_date DESC

I'm trying to escape "Sean "P. Diddy" Combs" with backslashes, but it doesn't 
work. This query returns every single row in my table, and it takes about 11 
seconds to run. The other queries take a fraction of a second.

Any help would be greatly appreciated. Thanks!

Shaun
http://www.blogfreaks.com

Reply via email to