-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #765 - single => true' on facet now works on "more" screen #767
Conversation
…cets new method, and called that new method in :solr_facet_params
I'd like to take a closer look at this and hopefully will have more comments, but before merging this PR should:
|
@@ -493,8 +499,10 @@ def solr_facet_params(facet_field, user_params=params || {}, extra_controller_pa | |||
solr_params = solr_search_params(user_params).merge(extra_controller_params) | |||
|
|||
# Now override with our specific things for fetching facet values | |||
solr_params[:"facet.field"] = facet_field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to re-use #add_facetting_to_solr
in its entirety? I think there's some other stuff going on there that we might want too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I wanted is to reuse :add_facetting_to_solr by sending the field_name with user_params, then in :add_facetting_to_solr return only one field in solr_params[:"facet.field"] if field_name is set.
This way we can delete the override line in :solr_facet_params.
To do that:
*1 - we need to refactor some more code, for example:
solr_parameters.append_facet_fields blacklight_config.facet_fields_to_add_to_solr
flattens to an array all the facet_fields, we need to change it too.
*2 - I think there is nothing more we need from :add_facetting_to_solr
Quite a mess with the indentation, I fixed it for the whole solr_helper.rb which made a lot of line changes. |
Replaced by #777 |
Great as long as the bug is fixed! Thanks :) |
Fixes #765
The bug was:
In :solr_facet_params which queries solr when opening the more window, we do this:
The problem is that we override logic that :add_facetting_to_solr is doing for special usecases like query facets, pivot facets and more..
The changes are:
*1 - Seperated some of :add_facetting_to_solr logic to a new method named :handle_advanced_facets
*2 - Now I can call the :handle_advanced_facets method also from :solr_facet_params
*3 - In the overriding line I changed facet_field from single value to an array
The fixes:
*1 - as described in #765.
*2 - this will fix many problems with the 'more' screen we didn't reach.