-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2110 from samvera/hyrax-5-upgrade-with-adventist-dev
Hyrax 5 upgrade with adventist dev
- Loading branch information
Showing
4 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,11 @@ FCREPO_BASE_PATH=/hykudemo | |
FCREPO_HOST=fcrepo | ||
FCREPO_PORT=8080 | ||
FCREPO_REST_PATH=rest | ||
HYRAX_ACTIVE_JOB_QUEUE=good_job | ||
HYRAX_ACTIVE_JOB_QUEUE=sidekiq | ||
HYRAX_FITS_PATH=/app/fits/fits.sh | ||
INITIAL_ADMIN_EMAIL=[email protected] | ||
INITIAL_ADMIN_PASSWORD=testing123 | ||
IN_DOCKER=true | ||
JAVA_OPTS= | ||
JAVA_OPTS=-Xmx4g -Xms1g | ||
LD_LIBRARY_PATH=/opt/fits/tools/mediainfo/linux | ||
NEGATIVE_CAPTCHA_SECRET=default-value-change-me | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
class AdvSearchBuilder < IiifPrint::CatalogSearchBuilder | ||
include Blacklight::Solr::SearchBuilderBehavior | ||
include BlacklightAdvancedSearch::AdvancedSearchBuilder | ||
|
||
# A Solr param filter that is NOT included by default in the chain, | ||
# but is appended by AdvancedController#index, to do a search | ||
# for facets _ignoring_ the current query, we want the facets | ||
# as if the current query weren't there. | ||
# | ||
# Also adds any solr params set in blacklight_config.advanced_search[:form_solr_parameters] | ||
def facets_for_advanced_search_form(solr_p) | ||
# ensure empty query is all records, to fetch available facets on entire corpus | ||
solr_p["q"] = '{!lucene}*:*' | ||
# explicitly use lucene defType since we are passing a lucene query above (and appears to be required for solr 7) | ||
solr_p["defType"] = 'lucene' | ||
# We only care about facets, we don't need any rows. | ||
solr_p["rows"] = "0" | ||
|
||
# Anything set in config as a literal | ||
solr_p.merge!(blacklight_config.advanced_search[:form_solr_parameters]) if blacklight_config.advanced_search[:form_solr_parameters] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe AdvSearchBuilder do | ||
let(:scope) do | ||
double(blacklight_config: CatalogController.blacklight_config, | ||
current_ability: ability) | ||
end | ||
let(:user) { create(:user) } | ||
let(:ability) { ::Ability.new(user) } | ||
let(:access) { :read } | ||
let(:builder) { described_class.new(scope).with_access(access) } | ||
|
||
it "can be instantiated" do | ||
expect(builder).to be_instance_of(described_class) | ||
end | ||
|
||
describe ".default_processor_chain" do | ||
subject { described_class.default_processor_chain } | ||
|
||
let(:expected_default_processor_chain) do | ||
# Yes there's a duplicate for add_access_controls_to_solr_params; but that does not appear to | ||
# be causing a problem like the duplication and order of the now removed additional | ||
# :add_advanced_parse_q_to_solr, :add_advanced_search_to_solr filters. Those existed in their | ||
# current position and at the end of the array. | ||
# | ||
# When we had those duplicates, the :add_advanced_parse_q_to_solr obliterated the join logic | ||
# for files. | ||
# | ||
# Is the order immutable? No. But it does highlight that you must consider what the changes | ||
# might mean and double check that join logic on files. | ||
%i[ | ||
default_solr_parameters | ||
add_search_field_default_parameters | ||
add_query_to_solr | ||
add_facet_fq_to_solr | ||
add_facetting_to_solr | ||
add_solr_fields_to_query | ||
add_paging_to_solr | ||
add_sorting_to_solr | ||
add_group_config_to_solr | ||
add_facet_paging_to_solr | ||
add_adv_search_clauses | ||
add_additional_filters | ||
add_range_limit_params | ||
add_access_controls_to_solr_params | ||
filter_models | ||
only_active_works | ||
add_advanced_parse_q_to_solr | ||
add_advanced_search_to_solr | ||
add_access_controls_to_solr_params | ||
show_works_or_works_that_contain_files | ||
show_only_active_records | ||
filter_collection_facet_for_access | ||
exclude_models | ||
highlight_search_params | ||
show_parents_only | ||
include_allinson_flex_fields | ||
] | ||
end | ||
|
||
it { is_expected.to eq(expected_default_processor_chain) } | ||
end | ||
end |