Someone
public sql v1 · immutable( SELECT DISTINCT f_topics.*, f_posts.id AS postID, (MATCH (f_posts.text) AGAINST ('%1\$s')) AS score FROM f_topics INNER JOIN f_posts ON f_posts.topicId = f_topics.id WHERE MATCH(f_posts.text) AGAINST ('%1\$s'))UNION( SELECT DISTINCT f_topics.*, 0 AS postID, (MATCH (f_topics.title) AGAINST ('%1\$s')*2) AS score FROM f_topics WHERE MATCH(f_topics.title) AGAINST ('%1\$s'))ORDER BY score DESCLIMIT 0,20