Skip to content

Commit

Permalink
Advanced form: only process facets that have include_in_advanced_sear…
Browse files Browse the repository at this point in the history
…ch: true

Before this commit, the AdvancedSearchFormComponent
processed any field in the CatalogController that did not
have include_in_advanced_search: false.

In theory, this should not be particularly expensive,
but a subtle bug in Blacklight causes some performance
issues in cases where we try to process fields that aren't
included in the Solr response and when the solr response
contains many facet values -- basically the exact situation
of our advanced search form!  See
projectblacklight/blacklight#3484
and projectblacklight/blacklight#3485
for further details.
  • Loading branch information
sandbergja committed Jan 4, 2025
1 parent 3a3c75b commit a186e39
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class Orangelight::AdvancedSearchFormComponent < Blacklight::AdvancedSearchFormComponent
def initialize_search_filter_controls
fields = blacklight_config.facet_fields.select { |_k, v| v.include_in_advanced_search || v.include_in_advanced_search.nil? }
fields = blacklight_config.facet_fields.select { |_k, v| v.include_in_advanced_search }

fields.each do |_k, config|
config.advanced_search_component = Orangelight::FacetFieldCheckboxesComponent
Expand Down

0 comments on commit a186e39

Please sign in to comment.