0

I'm looking for a way to allow a user to search 'within' current Solr search results (not search api solr results).

Is there existing functionality that provides this?

If I need to implement a module to do so, so be it; recommendations for what hooks to implement in that case would also be helpful.

Edit:

Re. amateurbarista's comment. I'm wondering if there is a way to make a second query against the results of a first. I don't think Facets allow me to do this, is that so?

For example suppose my first search query returns 10 nodes. I'm asking what it would take to allow a second query to search only within those 10 nodes.

2
  • 2
    Could you be more specific as to what "search within" means in your case? In Solr, facets are the way to do "search within": by using drill-down search on the facet end (selecting nested facets), and by searching for a query term (the ?q=foo parameter), then searching 'within' the 'foo' search term using facets... Commented Aug 21, 2013 at 22:20
  • @amateurbarista that is likely what I need. I'll explore that thank you.
    – SMTF
    Commented Aug 22, 2013 at 3:56

1 Answer 1

0

This is from my experience using Database Search not Solr but it might work.

I'm also not sure it's exactly what you're looking for but it might be a starting point.

  1. Clone your view, but keep the URL the same.

This allows you to run two exposed forms both of which re-direct to the same view. So I have one on my homepage and then one on my search results page. When you search from the home page the values are automatically populated into the second exposed form when you land on the results page.

Because the exposed forms are different this means you can show more fields on the exposed form on the search results page and because it remembers the first search, technically, you're searching within the original search.

2
  • That sounds like an interesting idea. The problem is that I can't use Solr Views because it doesn't support Solr spelling suggestions. I may be able to hook the search form to do something similar; however, It might make more sense to hook the second search query restricting it with the results of the first. I'm not clear on how to do this however.
    – SMTF
    Commented Aug 23, 2013 at 17:03
  • 1
    Hmm that's quickly moving out of my knowledge. Have your tried using either of the autocomplete modules, or chosen for select lists? Perhaps they would let use views. Otherwise not sure I can help much more, but best of luck! Commented Aug 25, 2013 at 11:09

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.