Add a subquery to the boolean query for each topic.