Yeah, there is an easier way to do it:

1. Create a set of words you want to ignore
2. Split the query by word
3. For each word in the query, see if it is in the set of words to ignore. If it is,...