Closed (duplicate)
Project:
Apache Solr Search
Version:
6.x-1.0-beta6
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
22 Mar 2009 at 02:01 UTC
Updated:
17 Jun 2009 at 23:09 UTC
I have Apache Solr Search up and running. When I go to the admin page I can see that there is a connection to the solr instance and I can also watch the operations in terminal when a search is executed.
However, when I run a search - it always defaults to the core search (content) and then I have to click on the search tab to bring up the solr results. I have checked my failure settings and it should give an error message rather than default if it was failing.
I assume I am doing something wrong here, but can't figure out how to have the solr results as the default for a given search.
Thanks.
Comments
Comment #1
pwolanin commentedThe base module does not, at the moment, override the core search block or make apachesolr the defualt - you can do this trivially with a custom module. Tehre is also an open issue to remove the dependence on the core search module, in which case apachesolr would be the default always if search module is disabled. see: http://drupal.org/node/405206
Comment #2
bacchus101 commentedThanks.
I did see that post but it did not offer any enlightenment to how to make apachesolr the default. I see that drupal.org has it setup as such and just assumed I was missing something.
I've done some searching but can't seem to pinpoint where this implementation is discussed. Are there any recipes out there that I am overlooking? I assume the majority of people would want the apachesolr results to be used if they are using this module.
I did notice with the lucene api module the search box could be hijacked via the settings. Is that the type of approach you are speaking of?
Basically, I don't care for the moment whether core search is enabled or not as long as I can force the default result set to be that of apachesolr. Otherwise, users would always end up using the core search as they would not know to click the search tab.
Edit: I found where this functionality is discussed.
http://drupal.org/node/341290
search.module line 1079
Replace:
with:
Comment #3
bacchus101 commentedMy issue has been resolved.
Comment #4
pwolanin commentedDon't hack core - you will be sorry when you go to upgrade - you should implement a custom module to change the submit handler via hook_form_alter.
See, e.g., the talk by Gabor and I at Drupalcon in DC.
Here's roughly the entire code of such a module
Comment #5
bacchus101 commentedAhh, just what I was looking for and it works like a charm.
Thanks.
Comment #6
akolahi commentedany chance of adding this as a sub-module to apachesolr, for us lesser drupalers? :D
Making Apache Solr the default search would be as simple as just enabling this module, along with the others.
Thanks.
Comment #7
pwolanin commentedWe have a separate issue to separate this module from dependence on core search - in that csae, it would obviously be the default if core search is not enabled. Robert Douglas had preferred to leave core search as default as you see it currently, so he's the one to convince.
Comment #8
akolahi commentedyeah i think it's probably a good idea leave core search as default, but i think it would be nice to have the option to make solr the default if one wanted to.
Comment #9
rjbrown99 commentedAny plans to integrate the module code from post #4 into this module or will we have to roll our own separate module for this? It seems like an easy enough addition and it would be nice to have it as part of the 'official' Apache Solr+Drupal module.
Comment #10
Scott Reynolds commentedYou can try Core Searches module. http://drupal.org/project/coresearches
the patch provided allows this behavior.
Comment #11
ayalon commentedI created a small module for this:
You can download it on my blog:
http://drupal.ayalon.ch/en/apache-solr-default-search
I does mainly the same as described above.
Greets Jon
Comment #12
pwolanin commentedhttp://drupal.org/node/405206