When a user enters a search query into an Apache Solr Search box, is it possible to pass that query onto a view - specifically to a Apache Solr Views view?
2 Answers
While you could technically do this by implementing a hook_form_alter
, to capture and overwrite the submit handler, if you're already using the Apache Solr Views module, you'd be better off creating an exposed filter, setting the exposed filters to display in a block, and then using that instead of the default search form block. You can do that without custom code.
-
Well I want to use apachesolr_autocomplete. It produces messy results when you integrate apachesolr_autocomplete into the views3 search filter.– JoeCommented Jun 28, 2011 at 2:38
You may try to use Search API with Solr support as it has better integration with Views and Drupal Recruter distribution is using exactly the same approach as you described. It has support for autocomplete, spell checker etc. as well.
So by creating exposed block in solr View, you're able to pass the query onto a view.