I have a simple "advice" question.

In my Rails App I am using Sunspot to perform searches across 2 models in my application - users and questions. Naturally when you think about this, there are several permutations to what a user might be looking for...

  1. looking for a user by name

  2. looking for questions posted by a specific user

3 looking for questions on a certain topic

  1. looking for questions with certain content.

Right now, the search returns all the relevant results on the term, so if I search for Johnny X, it returns a link to his profile, a whole load of questions he posted and even posts that reference him.

This I thought was pretty rubbish....you need the info organised in some way. So I thought of returning all whole lot but on the results page having pills or tabs that would say something like

"Limit search to members" "Limit search to content" "Limit search to content by a member"

This still feels pretty rubbish.

If I limited my search to just one model then it would be easier, but really I want an all-encompassing search..

Advice needed....I hope I have explained the problem.

2 Answers 2


We faced a similar problem and took a hint from "Spotlight" design.


You can see how the search results have been categorized based on Metadata. I think you can show it in a similar way using Sunspot.

We achieved a similar result using Sphinx. We had a usability testing done with this kind of categorized search UI as against returning results in the usual list view. A whopping 81% of our users were able to find results quickly with the categorized UI.

enter image description here

  • +1 very nice! one question, though: what do you mean with Sphinx? The search engine?
    – Devin
    Aug 13, 2015 at 23:51
  • Yes, it's a full text search engine server - sphinxsearch.com
    – Adit Gupta
    Aug 14, 2015 at 3:38
  • After playing around with sunspot I came up with a solution based on spotlight as you described! Perfect. Many thanks
    – GhostRider
    Aug 14, 2015 at 13:22
  • Really glad to hear that @GhostRider :)
    – Adit Gupta
    Aug 14, 2015 at 13:46

Before making users filter/facet down the results you could let them filter down the search itself, like this (screenshot taken at LinkedIn):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.