projectblacklight / blacklight_advanced_search

Advanced search plugin for Blacklight
http://projectblacklight.org
Other
25 stars 25 forks source link

Specifying :form_solr_parameters in config.advanced_search does not modify Solr request #6

Closed thomasrussellmurphy closed 10 years ago

thomasrussellmurphy commented 11 years ago

Inside my configure_blacklight do |config| block, I have added:

    config.advanced_search = {
        :form_solr_parameters => {
            "facet.field" => ["orgid", "noteType"]
        }
    }

However, the /advanced view is displaying the default facets from the Solr search requestHandler. Furthermore, the log output from Solr that corresponds to loading the advanced search is:

INFO  org.apache.solr.core.SolrCore  ? [collection1] webapp=/solr path=/select params={wt=ruby} hits=1000000 status=0 QTime=49 

This indicates that nothing is being changed by setting :form_solr_parameters in config.advanced_search. Am I missing something or is this really not working? Adding a :qt that doesn't exist to the config.advanced_search does produce an error, so the variable is being set.

simonlamb commented 11 years ago

I'm currently experiencing this very same issue. I've looked through the code and can't spot any obvious reasons to why it isn't working. Any ideas?

jrochkind commented 10 years ago

yes, I seem to be able to reproduce. The code that's supposed to respect this doesn't seem to have changed in a while, but I guess it's stopped working in more recent versions of BL. I'll try and figure it out.

jrochkind commented 10 years ago

Blacklight accidentally broke backwards compat of a SolrHelper#find method way back in BL 4.0, breaking blacklight_advanced_search, and introducing a really awkward api for SolrHelper#find.

The new api is, IMO buggy, but it's also been there since 4.0. I'm not sure if I should write to the weird buggy api, or do something else.

jrochkind commented 10 years ago

I believe this has been fixed by #10.

Trying to limit what facet fields are included on the search form may still interact weirdly with pivot facetting and the tag/exclude facet features supported by newer BL's, if you're using them. I don't understand enough about how those work to know what's going on and how to deal with it, but I think it's a different issue -- the form_solr_parameters should now be correctly merged into Solr request params when making the solr request to get facet values for the advanced search form page.

There will shortly be a new BL 4.x-compatible release incorporating this and other fixes and improvements.

Sorry it took so long for someone to get to this!