freelancing-god/thinking-sphinx — pull request #373 by pixeltrix (2012-07-18 12:16:58+00:00)
Title: Add support for association-filtered faceting (v1)

It's a common use case that faceting needs to be scoped to a subset.
Whilst this can be done manually, it's easy to extend the built-in
support for association-filtered searching to faceting as well, e.g:

Currently:

@facets = Product.facets :with => { :manufacturer_id => @manufacturer.id }

After this commit:

@facets = @manufacturer.products.facets

Whilst technically this changes current behavior the difference
between searching and faceting through an association is inconsistent
and I feel it should be considered a bug.