I’m not sure if this is the best options, but you can make these with simple JavaScript.
If user search words, save them and create an sessionStorage. If he trying to create new post, check sessionStorage.
If sessionStorage contain one words from topic title (or content), allow user to create topic. Otherwise, disallow it.