Multi Search with Ferret, Pagination and Sorting

Posted on December 28, 2007
I had to do a search with ferret for a single model and multiples queries, plus sorting in pagination.
for example, I wanted to search for a User with name="John Smith" AND city="atlanta" AND state="ga" AND zip=100*

here is my implementation

The model code, I got it from Igvita Ferret Pagination in Rails and slightly modified.

Search with ferret using will_paginate

Posted on December 07, 2007

I love Sphinx search, but most shared hosting won’t have sphinx…. Sphinx returns the results already “will_paginated” :)

So I have to use my second most favorite indexing tool, acts_as_ferret.