MySQL: Match() Against () case insensitive search problem

Discussion in 'MySQL' started by freestate, May 13, 2008.

  1. #1
    Hi,

    Been struggling with this one for the whole afternoon, so thought I'd put it out for another opinion!

    I'm building a boolean search function on a recruitment database, with a query like this as the main 'mechanics':

    SELECT jsid,name,surname,description1,cvfile FROM jobseeker WHERE MATCH(name,surname,description1,cvfile) AGAINST ('+(Jones Smith) +sales +(advertising publishing) -Manager' IN BOOLEAN MODE) ORDER BY surname, name limit 0,10
    Code (markup):
    Now, the problem is that if I change the case of (Jones Smith) to (jones smith) I get a completely different set of results. (Same if I change -Manager to -manager)

    Everything I've read says by default the search should be case insensitive. I've checked the collation of the table, and this is latin1_swedish_ci, which looks fine.

    The only solution I can see to make searches case insensitive is to use the UPPER() command in SQL, with str_to_upper on the variables - which would be fine, but I can't work out how to use MATCH() and UPPER() at the same time!

    Any ideas?
     
    freestate, May 13, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    itcn, May 19, 2008 IP