In Misago this situation may be easily solved with custom search filters that post and search queries are passed through before they are sent to search engine. Those filters are simple python functions that take string as only argument, do something with it, and then return changed string back, like this: