When Solr search fails and the user is being redirected to Drupal core search results, I don't think it makes any sense to tell the end user the technical details of what's happening. First of all, the message as it's currently worded is going to be confusing for them, and second of all (as I understand it), the whole point in falling back on core Drupal search is so that the end user doesn't even know your site is "broken"....
This patches changes things so that only site admins see the message (and also makes the message more helpful for the site admin).
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | solr_not_available_message-349840-1.patch | 1.98 KB | pwolanin |
| solr_not_available_message.patch | 1.2 KB | David_Rothstein |
Comments
Comment #1
pwolanin commentedrefreshed patch
Comment #2
David_Rothstein commentedOK, I confirmed that the new patch works. (Or works as well as the old behavior, at any rate. There seems to be a bug that is causing the apachesolr_failure function to not get called at all sometimes, but I'll file that as a separate issue.)
Comment #3
pwolanin commentedthanks, committed to 6.x
Comment #4
David_Rothstein commentedHm... well after looking into it a little more, I discovered that what I thought was a separate bug wasn't really a bug -- it's actually a problem with this patch.
My confusion was due to the fact that I've been mostly using Apache Solr with other helper modules that play around with the search tabs. However, if you are just using this module by itself, the fact that searches are being redirected is something the end user will notice, so that's why they were getting a message about it. In particular, the user gets separate "Search" (Apache Solr) and "Content" (Drupal core) tabs on their search results, and the only way they get to the Solr results is to click on the "Search" tab. When searches are being redirected, therefore, the user clicks on the Search tab but winds up on Content instead, and it's somewhat disconcerting to be on the wrong tab with no explanation.
That said, I don't think I had the wrong idea with this patch... Site admins are going to choose this option because they want their end users to have the smoothest experience possible when Solr is down, and right now the module does not give it to them -- it forces a drupal_set_message() that the site admin can't remove even though they may very likely want to.
Perhaps the right solution is to give the Apache Solr module an option to override Drupal core's node search completely -- as discussed in #281461: Default search type, but using a better implementation (@pwolanin already has one developed)? Then we could show or not show the redirect message to end users based on which option the site admin has chosen...
Comment #5
pwolanin commentedok, rolling back for now.
Comment #6
jpmckinney commentedFixed by virtue of not redirecting to core search anymore.
Comment #7
David_Rothstein commentedNot sure what you mean by that? It's certainly still an option, and the patch even still applies.
Comment #8
jpmckinney commentedOops, thought it was being applied to a different part of the code. At any rate, it's not a bug. Administrators should not *plan* to use the fallback, so I don't see the message as a user experience FAIL in every imaginable case. There should maybe be an option to hide it. I can imagine advantages to showing it.
Comment #9
jpmckinney commentedComment #10
nick_vhas far as I can see this is fixed in Drupal 7 because of the possibility that drupal core search can be overridden and the administrator can choose whatever he wants to do when a search fails.
Please correct me if I'm wrong?