Skip to content
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

Setting ':single => true' on a facet does not affect the "more" screen #765

Closed
eranhirs opened this issue Feb 10, 2014 · 9 comments
Closed
Milestone

Comments

@eranhirs
Copy link
Contributor

When setting :single => true on a facet it does not affect the "more" screen.
For example, set a limit on 'pub_date' facet like this:

config.add_facet_field 'pub_date', :label => 'Publication Year', :single => true, :limit => 10

then try choosing a value, then click the "more" button.
You will see only the selected facet not all of them like expected when setting ':single => true'

@cbeer
Copy link
Member

cbeer commented Feb 10, 2014

In fact, most facet options don't play nice with the more-screen.

@cbeer cbeer added this to the 5.1.0 milestone Feb 10, 2014
@jrochkind
Copy link
Member

Where would I find docs on all the facet options? I hadn't known about :single => true, and am still not sure what it does.

@eranhirs
Copy link
Contributor Author

@cbeer - I will open a pull request soon that fixes a lot of the problems
@jrochkind - generated catalog_controller.rb comes with a :single => true facet (that's how I noticed it), and this is a good explanation what it does:
http://wiki.apache.org/solr/SimpleFacetParameters#Multi-Select_Faceting_and_LocalParams

@jrochkind
Copy link
Member

Thanks @eranhirs. I see the example here:

https://github.com/projectblacklight/blacklight/blob/master/lib/generators/blacklight/templates/catalog_controller.rb#L53

But I'm still not sure what it does -- you linked to the Solr docs on Multi-Select Facetting and LocalParams. So it's got something to do with that? But what? :single => true... turns on multi-select or something?

@eranhirs
Copy link
Contributor Author

It does 2 things:
*1 - Multi-select facet as described in the link I posted, meaning that even if you select a facet value all the other values still appear as if you didn't press a facet value.
You can see here:
https://github.com/projectblacklight/blacklight/blob/master/lib/blacklight/configuration/facet_field.rb
that it sets in Configuration::FacetField 2 members: tag & ex which are later used in the solr_search_params_logic pipeline. (methods using it: :add_facet_fq_to_solr, :add_facetting_to_solr)

*2 - It also makes the facets swap when clicking a facet value. For example you clicked "Pdf", then pressed "Word", because you set :single => true then "Pdf" will swap with "Word" instead of them both being selected.

*1 is using solr's implementation, while *2 is blacklight's internal implementation.

@cbeer
Copy link
Member

cbeer commented Feb 10, 2014

@eranhirs
Copy link
Contributor Author

@cbeer how do I add a pull request to this issue?

@cbeer
Copy link
Member

cbeer commented Feb 10, 2014

Just reference it in the PR (e.g. Fixes #765)

@eranhirs
Copy link
Contributor Author

PR #767

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants