Yeah, with a purely SQL solution, you can’t do anything more complex. I’m working on another solution but will probably not be suitable for this gem, because it will run in memory on a dedicated server. This code is kind of like an abstraction of the AR chaining with some re-ordering to make it evaluate more effectively. It doesn’t change the core functionality at all. By the way, I really appreciate the work you do here, so let me know if there’s any way I can help out. 

On Dec 27, 2013, at 10:24 AM, Benjamin Fleischer <notifications@github.com> wrote:

> In lib/acts_as_taggable_on/expression.rb:
> 
> > @@ -0,0 +1,117 @@
> > +module ActsAsTaggableOn
> > +  module Expression
> > +    
> > +    ##
> > +    # Executes a tag search using +, - and & operators.
> > +    # Use the :expression option to add an expression string.
> > +    # Use the :default_chaining to evaluate the expression using onyl ActiveRecord chaining.
> > +    # However, default chaining may return less than desired results. 
> So, by expression, do you mean set operations, only?
> 
> —
> Reply to this email directly or view it on GitHub.
>