MySQL Forums
Forum List  »  Newbie

match against search won't match strings with a forward slash in them
Posted by: Charles Tronolone
Date: February 12, 2009 03:54PM

Here's my query:

SELECT id, title, MATCH(title, tags) AGAINST('road/street') AS score FROM some_table WHERE MATCH(title, tags) AGAINST('road/street')

The result of this query is that I should get all the rows where the title has the the string 'road/street' in it. Well, that's what I think I should get anyway, but I don't. Instead, I get every row where the title has either "road" or "street" in it. What I think it happening is that mySQL is considering the forward slash to be a space and is searching for either "road" or "street".

I want only the results where the slash is part of the string. I tried putting an '\' before the backslash to escape it, but nothing changed. Is there a different mySQL escape character that I don't know about?

Thanks for any help.



Edited 1 time(s). Last edit at 02/12/2009 04:28PM by Charles Tronolone.

Options: ReplyQuote


Subject
Written By
Posted
match against search won't match strings with a forward slash in them
February 12, 2009 03:54PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.