I don't know the exact syntax any more, but I expect this could be solved by a single sql query that uses "inexact but close" queries and a bunch of indexes (and perhaps tags) on each category.
[1] https://www.postgresql.org/docs/current/textsearch-intro.htm...
[2] https://www.elastic.co/docs/explore-analyze/query-filter