Whats wrong with this query?:
(
SELECT 'blog' as type, id, title, image, text, MATCH(title, text) AGAINST('lorem' IN BOOLEAN MODE) as match
FROM blog
WHERE
publish_date > '2013-06-19 00:00:00' AND
match
)
UNION ALL
(
SELECT 'page' as type, id, title, null as image, text, MATCH(title, text) AGAINST('lorem' IN BOOLEAN MODE) as match
FROM pages
WHERE match
)
ORDER BY match
LIMIT 10, 0;
one query, nothing combined in php, no index to update/reindex
(edit: coderwall removes retuns in some cases so it seems my point was making the querys UNION together)
Achievements
9
Karma
0
Total ProTip Views
Charity
Fork and commit to someone's open source project in need
Whats wrong with this query?:
(
SELECT 'blog' as type, id, title, image, text, MATCH(title, text) AGAINST('lorem' IN BOOLEAN MODE) as match
FROM blog
WHERE
publish_date > '2013-06-19 00:00:00' AND
match
)
UNION ALL
(
SELECT 'page' as type, id, title, null as image, text, MATCH(title, text) AGAINST('lorem' IN BOOLEAN MODE) as match
FROM pages
WHERE match
)
ORDER BY match
LIMIT 10, 0;
one query, nothing combined in php, no index to update/reindex
(edit: coderwall removes retuns in some cases so it seems my point was making the querys UNION together)