i am creating the string out of a set of terms which will not change. basically just adding them in with a bunch of AND|OR|NOT and parens.
The idea is some articles contain a list of keywords and i'm trying to run the search string over them to find which ones match. it's not too hard until i got to recursive parens, which was where i decided to break it down to a hash of "rules" which are run individually (kinda from the inside out) making sure each one "passes" on the way.