Closed (fixed)
Project:
Sarnia
Version:
7.x-1.1-beta7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Aug 2015 at 14:23 UTC
Updated:
28 Aug 2015 at 14:33 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tlyngej commentedThis is one way of fixing it. There might be a better way though.
Comment #3
jmdeleon commentedSeems like a reasonable check to do, and a simple way to handle the situation. Any suggestions as to how this can be tested?
Comment #4
tlyngej commentedMy use case was a Solr 4.7.2, using the DIH mail config. But I'm not sure if it is a general thing. But I assume not, as I guess more would have complained about it. :-)
Comment #5
jmdeleon commentedThat's great, thanks! (for the follow-up and the patch)
Comment #7
jmdeleon commentedComment #8
jmdeleon commentedComment #12
jmdeleon commentedComment #14
dcam commentedJust FYI, versions of Sarnia prior to our recent work wouldn't have had this problem. It was the removal of the hard-coded requestHandler names that caused certain configurations to not return results without a search. You'll see in that comment that I noted the standard requestHandler would not return any results by default because the
$call_args['query'] = '*:*'was removed.I didn't really consider it a problem because I figured people could adjust their requestHandler config to return all results by default. This makes me wonder what is better (although I realize the patch has already been committed). Is it better to hard-code the module to return all results by default to avoid any confusion that might be caused by empty result sets? On the other hand, is there a use case that we're preventing where someone might not want all records to be returned? Therefore, is it more responsible to leave the configuration up to the admin in their Solr config files? I don't know the answer to those questions. My instinct says "we probably should leave that up to the Solr config." At least that is mitigated by the fact that you can configure Views to not display anything if a search has not been performed, so there is an easy workaround.
Anyway, configuring the module to use the standard requestHandler should be the easy way to test if this patch works. Use the Drupal Common Config files, set the Sarnia server config requestHandler to "standard", then test to see if it returns no results by default (without a search being performed) before the patch and then see if it returns results afterward.
Comment #15
tlyngej commentedRight, maybe a revert of this patch might be in order then. I thought that this was related to the old version of Solr.
Let's say that I'm not in control of the Solr instance running this core. And the core isn't setup with any kind of Drupal in mind. Would there be any way to verify whether the server is specifically set to return no result, if the query is empty?
Could we maybe add a setting in the Sarnia setup that allowed Drupal to either respect this or override it?
Comment #16
jmdeleon commenteddcam: I guess that's what dev version builds are for :)
I kind of like the idea of having an interface for a default query. When this patch was first submitted, the thought ran through my mind that making an assumption on the default query behavior might not be the best thing, but there is also the case where one might not be in control of the source Solr core, and might have to mitigate against it.
Comment #17
jmdeleon commentedHere's a proposed patch that puts an interface to the default query parameter in the Sarnia server settings.
Comment #18
jmdeleon commentedComment #20
jmdeleon commentedRe-rolling patch in #17 to use Unix-style line endings.
Comment #21
jmdeleon commentedPatch in message #20 (mis-labeled as #18) returned an error, when re-saving a Sarnia index (and not a server entity). This patch remedies that error.
Comment #22
jmdeleon commentedComment #23
jmdeleon commentedFixed paths in #21 and re-rolled, in case some people had trouble applying.
Comment #25
jmdeleon commentedCommitting the patch in #23 to dev. Adding the default query allowed a lot of the demo cores that come with Solr to work and display Views, as tlyngej noted with the Solr mail demo core. It had been a stretch goal of mine to get the "techproducts" db DataImportHandler demo working that was included with Solr, and I was able to get it displaying Views properly with this series of patches. #23 incorporates the originally submitted patch, plus adds a UI to the Sarnia server config to override the default query, if that is ever needed.
Comment #26
jmdeleon commentedComment #30
jmdeleon commentedComment #31
tlyngej commentedSplendid work! (highfive)