I tried:
SELECT id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on, MAX(MATCH(itm_desc, itm_title, itm_link, itm_author, itm_categories) AGAINST('XSS')) as score FROM fmc_archive_dev WHERE ((MATCH(itm_desc, itm_title, itm_link, itm_author, itm_categories) AGAINST('XSS')) AND (archived_on > 1181277356) AND (cat_id = 3)) GROUP BY id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on UNION SELECT id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on, MAX(MATCH(itm_desc, itm_title, itm_link, itm_author, itm_categories) AGAINST('WAF')) as score FROM fmc_archive_dev WHERE ((MATCH(itm_desc, itm_title, itm_link, itm_author, itm_categories) AGAINST('WAF')) AND (archived_on > 1181320556) AND (cat_id = 1 OR cat_id = 3 OR cat_id = 4 OR cat_id = 11 OR cat_id = 12 OR cat_id = 13 OR cat_id = 14 OR cat_id = 15 OR cat_id = 16 OR cat_id = 23 OR cat_id = 43 OR cat_id = 44)) GROUP BY id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on ORDER BY score DESC
SELECT id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on, MAX(
MATCH (
itm_desc, itm_title, itm_link, itm_author, itm_categories
)
AGAINST (
'XSS'
) ) AS score
FROM fmc_archive_dev
WHERE (
(
MATCH (
itm_desc, itm_title, itm_link, itm_author, itm_categories
)
AGAINST (
'XSS'
)
)
AND (
archived_on >1181277356
)
AND (
cat_id =3
)
)
GROUP BY id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on
UNION SELECT id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on, MAX(
MATCH (
itm_desc, itm_title, itm_link, itm_author, itm_categories
)
AGAINST (
'WAF'
) ) AS score
FROM fmc_archive_dev
WHERE (
(
MATCH (
itm_desc, itm_title, itm_link, itm_author, itm_categories
)
AGAINST (
'WAF'
)
)
AND (
archived_on >1181320556
)
AND (
cat_id =1
OR cat_id =3
OR cat_id =4
OR cat_id =11
OR cat_id =12
OR cat_id =13
OR cat_id =14
OR cat_id =15
OR cat_id =16
OR cat_id =23
OR cat_id =43
OR cat_id =44
)
)
GROUP BY id, itm_desc, itm_link, itm_title, itm_categories, itm_author, itm_date, feed_id, cat_id, archived_on
ORDER BY score DESC
LIMIT 0 , 300
It gave me duplicates still:
ROW:
128388 <p>I’ve been thinking about this for a long ... http://ha.ckers.org/blog/20070608/the-virtues-of-w... The Virtues of WAF Egress a:2:{i:0;s:3:"XSS";i:1;s:9:"Webappsec";} RSnake 1181324069 57 3 1181325343 8.03860855102539
And DUPLICATE ROW:
128388 <p>I’ve been thinking about this for a long ... http://ha.ckers.org/blog/20070608/the-virtues-of-w... The Virtues of WAF Egress a:2:{i:0;s:3:"XSS";i:1;s:9:"Webappsec";} RSnake 1181324069 57 3 1181325343 4.19421482086182
Notice they both have different scores: 8.03860855102539 and 4.19421482086182
I'd like the result to pick out the row with 8.03860855102539 as the score and get rid of the item with the score of 4.19421482086182