You might have to do both. Be sure, however, that MySQL is doing all the filtering that it can, because you don’t want to send those millions-of-rows across a network-wire between two servers, just to throw away nearly-all of them. (Whereas doing a local-disk-drive scan of millions of rows is actually not so bad.)
Also, seriously consider any features that MySQL may offer, including its word-based indexing capabilities for large-text fields. If you do this stuff “frequently,” it becomes the classic tradeoff of Speed vs. Space, in several ways. Benchmark your ideas carefully.