I started working on a Boolean search mechanism, and it''s finally starting to come together. I''m sure there are tons of ways to improve and refactor the code, but I wanted to make my progress available so that some others might have a starting point if they want to do something similar. Being a newbie, it took me all day to come up with this, but basically the functionality is rather simple. Basically, it takes a query and splits it up into elements such as (,),and,or,not, and [search term]. The query is rewritten into Ruby code by substituting and,or,not with &,|,- and the search terms with arrays from DB lookups. Then the dynamic Ruby code is evaluated with the eval method. For example: The query... (this or that) and (x not (y or z)) becomes... eval (this_array | that_array) + (x_array - (y_array | z_array)) The code hasn''t been sanitized, so there''s still lots of code that is specific to my own application. Hope this helps somebody. Bryce http://tenyearsof.us (soon to be evolved from PHP to RoR) see attached file. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails