MySQL Join and Match/Against Search Fail
Asked Answered
K

1

0

I'm basically trying to create a search to find articles (or articles from an author). I've ended up with this query:

   SELECT `articles`.*, `authors`.*
     FROM `articles`
LEFT JOIN `authors` ON (`authors`.`id` = `articles`.`author_id`)
    WHERE MATCH (`articles`.`title`, `articles`.`description`)
            AGAINST ("test")
       OR MATCH (`authors`.`first_name`, `authors`.`last_name`)
            AGAINST ("test")
 GROUP BY `articles`.`id`

I have made sure that all four matched fields are FULL TEXT indexes. The search matches against and finds all articles made by a user with first name 'Kevin' but will not match if I search for articles named 'Test' (which exists).

Know answered 8/5, 2011 at 3:14 Comment(0)
C
0

Match against will not find a score for "stop" words.

Stop words are words that occur in 50%+ of the results,
or that are in the official stop word list™.

See: http://dev.mysql.com/doc/refman/5.5/en/fulltext-stopwords.html
And: http://dev.mysql.com/doc/refman/5.5/en/fulltext-search.html

For finetuning Match Against see: http://dev.mysql.com/doc/refman/5.5/en/fulltext-fine-tuning.html

Chappie answered 8/5, 2011 at 3:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.