To focus a query on a specific field, you can use the :conditions option - much like in ActiveRecord:
You can combine both field-specific queries and generic queries too:
Please keep in mind that Sphinx does not support SQL comparison operators - it has its own query language. The :conditions option must be a hash, with each key a field and each value a string.
Filters on attributes can be defined using a similar syntax, but using the :with option.
Filters have the advantage over focusing on specific fields in that they accept arrays and ranges:
And of course, you can mix and match global terms, field-specific terms, and filters:
Sphinx paginates search results by default. Indeed, there’s no way to turn it off (but you can request really big pages should you wish). The parameters for pagination in Thinking Sphinx are exactly the same as Will Paginate: :page and :per_page.
The output of search results can be used with Will Paginate’s view helper as well, just to keep things nice and easy.