Pragmatic approach to k-means clusters with PostgreSQL
you could use the ranking returned from the text search as a cut-off to decide if the question matches a topic. 
For each category you could hold a document with relevant terms and search the query text against these terms. 

Btw, there's a nice extension called madlib (it's more of a utility package) - it contains many useful features/algorithms including topic analysis &amp; clustering. 
Take a look at madlib documentation