Take the 2-minute tour ×

I've tried thinking sphinx after being pointed in that direction and simple filtering seems impossible. I've googled and asked questions for 2 days now and it seems it can't be done which is shocking because it's something commonly done when searching on websites.

All I would like to do add filtering options to my search form such as filtering by one or a combination of:

When user hits browse page all the sites users are returned but showing 20 results per page

Filtering options

in: location

who are: sexual preference

between the ages: age range

and located in: country

My search page works fine because all I require is 1 textfield a user uses for finding users by email, username or full name. My browse page is a different story because I'm using 1 form with multiple text fields and one or two select fields.


Is there a gem that does this easily and performs well at the same time?

or would doing this manually via find methods be the only way?

Kind regards

share|improve this question
try github.com/ernie/ransack –  Vasiliy Ermolovich Jan 28 '12 at 11:15
add comment

2 Answers

up vote 0 down vote accepted

Apart from using Sphinx and Thinking Sphinx, you can think of those gems: meta_where and meta_search

However after reading your description I think Sphinx is the best choice here indeed.

You wrote that it seems impossible to apply simple filtering using Thinking Sphinx. Let me explain a bit of Thinking Sphinx within the post you mentioned under the link: Example

share|improve this answer
The impression that I got from most responses round the web was that it was not possible to allow users to filter their search results. If this is possible then I can finally get my search feature finished. –  LondonGuy Jan 28 '12 at 12:22
The only way I can get filtering to work is automatically through my controller using conditions. That still doesn't allow me to give that power to my user. I've tried passing params in as the value of the key and I get an error. When I pass a number in manually it works.. but is pointless. –  LondonGuy Jan 28 '12 at 12:32
add comment

You can go for Elasticsearch. Ruby has the 'Tire' gem, which is a client for ElasticSearch http://www.elasticsearch.org/

share|improve this answer
add comment

Your Answer


