pat/thinking-sphinx — pull request #557 by epidemian (2013-07-08 15:53:01+00:00)
Title: Respect :limit option on FacetSearch

This PR makes it possible for the user to specify a `limit` option on a facet search.

An example use case for this could be getting the 5 authors with the most amount of books:

```ruby
top_authors = Book.facets(order: '@count desc', limit: 5)[:author]
```

This approach could be useful for showing which artists have the most books with a given query, or similar filters.

----

Semi on-topic: the `order: '@count desc'` option is something that we always use when retrieving facets, as we're mostly interested in getting the facets with the most amount of matches. Wouldn't it make sense to add this option as a default behaviour of facets searches?