diff --git a/.rubocop.yml b/.rubocop.yml index bdb539d2..66bd81d9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,7 +6,7 @@ inherit_gem: Layout/LineLength: Exclude: - - spec/support/solr_documents/metadata_cloud_with_visibility.rb + - spec/support/solr_documents/* # Views do not have classes or modules RSpec/DescribeClass: diff --git a/Gemfile b/Gemfile index 97768f72..5734cddd 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,7 @@ gem 'awesome_print' gem 'blacklight', '>= 7.0' gem 'blacklight-gallery' gem 'blacklight-marc', '>= 7.0.0.rc1', '< 8' +gem "blacklight_advanced_search" gem 'blacklight_range_limit' gem 'bootsnap', '>= 1.4.2', require: false gem 'bootstrap', '~> 4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 4d4f35f7..f55ab2c4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,6 +101,9 @@ GEM marc-fastxmlwriter rails traject (~> 3.0) + blacklight_advanced_search (7.0.0) + blacklight (~> 7.0) + parslet blacklight_range_limit (7.8.1) blacklight (>= 7.0) bootsnap (1.4.8) @@ -254,6 +257,7 @@ GEM parallel (1.19.1) parser (2.7.1.3) ast (~> 2.4.0) + parslet (2.0.0) pg (1.2.3) popper_js (1.16.0) public_suffix (4.0.5) @@ -465,6 +469,7 @@ DEPENDENCIES blacklight (>= 7.0) blacklight-gallery blacklight-marc (>= 7.0.0.rc1, < 8) + blacklight_advanced_search blacklight_range_limit bootsnap (>= 1.4.2) bootstrap (~> 4.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 81e2deff..fbe4ebc2 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,4 +1,7 @@ //= require jquery +//= require 'blacklight_advanced_search' + + //= require jquery3 //= require rails-ujs //= require turbolinks diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 178facff..87a813b8 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -15,7 +15,7 @@ * Used by blacklight_range_limit *= require 'blacklight_range_limit' * - */ +*/ @import 'bootstrap'; @import 'blacklight/blacklight', 'blacklight_marc'; diff --git a/app/controllers/catalog_controller.rb b/app/controllers/catalog_controller.rb index 2e6bc139..d7e098ad 100644 --- a/app/controllers/catalog_controller.rb +++ b/app/controllers/catalog_controller.rb @@ -1,10 +1,19 @@ # frozen_string_literal: true class CatalogController < ApplicationController + include BlacklightAdvancedSearch::Controller include BlacklightRangeLimit::ControllerOverride include Blacklight::Catalog include Blacklight::Marc::Catalog configure_blacklight do |config| + # default advanced config values + config.advanced_search ||= Blacklight::OpenStructWithHashAccess.new + # config.advanced_search[:qt] ||= 'advanced' + config.advanced_search[:url_key] ||= 'advanced' + config.advanced_search[:query_parser] ||= 'edismax' + config.advanced_search[:form_solr_parameters] ||= {} + + ## Gallery View config.view.gallery.partials = [:index_header] config.show.tile_source_field = :content_metadata_image_iiif_info_ssm config.show.partials.insert(1, :openseadragon) @@ -102,7 +111,7 @@ class CatalogController < ApplicationController assumed_boundaries: [1100, Time.current.year + 2], segments: true, maxlength: 4 - } + }, include_in_advanced_search: false # the facets below are set to false because we aren't filtering on them from the main search page # but we need to be able to provide a label when they are filtered upon from an individual show page @@ -232,18 +241,28 @@ class CatalogController < ApplicationController # Array allows for only listed Solr fields to be searched in the 'All Fields' search_fields = ['abstract_tesim', 'author_tesim', 'alternativeTitle_tesim', 'description_tesim', 'subjectGeographic_tesim', - 'identifierShelfMark_tesim', 'orbisBidId_ssi', 'publicatonPlace_tesim', 'publisher_tesim', + 'identifierShelfMark_tesim', 'orbisBibId_ssi', 'publicatonPlace_tesim', 'publisher_tesim', 'resourceType_tesim', 'sourceCreated_tesim', 'subjectName_tesim', 'subject_topic_tesim', 'title_tesim'] config.add_search_field('all_fields', label: 'All Fields') do |field| field.qt = 'search' + field.include_in_advanced_search = false field.solr_parameters = { qf: search_fields, pf: '' } end + config.add_search_field('all_fields_advanced', label: 'All Fields') do |field| + field.qt = 'search' + field.include_in_simple_select = false + field.solr_parameters = { + qf: search_fields.join(' '), + pf: '' + } + end + # Now we see how to over-ride Solr request handler defaults, in this # case for a BL "search field", which is really a dismax aggregate # of Solr search fields. @@ -268,6 +287,7 @@ class CatalogController < ApplicationController # config[:default_solr_parameters][:qt], so isn't actually neccesary. config.add_search_field('subjectName_ssim', label: 'Subject') do |field| field.qt = 'search' + field.include_in_advanced_search = false field.solr_parameters = { qf: '', pf: 'subjectName_ssim' @@ -282,6 +302,23 @@ class CatalogController < ApplicationController } end + config.add_search_field('oid_ssi', label: 'OID') do |field| + field.qt = 'search' + field.include_in_simple_select = false + field.solr_parameters = { + qf: 'oid_ssi', + pf: '' + } + end + + config.add_search_field('identifierShelfMark_tesim', label: 'Identifier Shelf Mark') do |field| + field.qt = 'search' + field.include_in_simple_select = false + field.solr_parameters = { + qf: 'identifierShelfMark_tesim', + pf: '' + } + end # "sort results by" select (pulldown) # label in pulldown is followed by the name of the SOLR field to sort by and # whether the sort is ascending or descending (it must be asc or desc diff --git a/app/controllers/saved_searches_controller.rb b/app/controllers/saved_searches_controller.rb new file mode 100644 index 00000000..e9051e9b --- /dev/null +++ b/app/controllers/saved_searches_controller.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true +class SavedSearchesController < ApplicationController + include Blacklight::SavedSearches + + helper BlacklightAdvancedSearch::RenderConstraintsOverride +end diff --git a/app/controllers/search_history_controller.rb b/app/controllers/search_history_controller.rb index 83a21bb7..2a357600 100644 --- a/app/controllers/search_history_controller.rb +++ b/app/controllers/search_history_controller.rb @@ -3,5 +3,7 @@ class SearchHistoryController < ApplicationController include Blacklight::SearchHistory helper BlacklightRangeLimit::ViewHelperOverride + # helper BlacklightAdvancedSearch::RenderConstraintsOverride helper RangeLimitHelper + helper BlacklightAdvancedSearch::RenderConstraintsOverride end diff --git a/app/models/search_builder.rb b/app/models/search_builder.rb index 71e6a4e6..7f3e7cf4 100644 --- a/app/models/search_builder.rb +++ b/app/models/search_builder.rb @@ -13,8 +13,12 @@ # end class SearchBuilder < Blacklight::SearchBuilder include Blacklight::Solr::SearchBuilderBehavior + include BlacklightAdvancedSearch::AdvancedSearchBuilder include BlacklightRangeLimit::RangeLimitBuilder + self.default_processor_chain += [:add_advanced_parse_q_to_solr, :add_advanced_search_to_solr] + # include BlacklightRangeLimit::RangeLimitBuilder + # Add the `show_only_public_records` method to the processor chain self.default_processor_chain += [:show_only_public_records] self.default_processor_chain += [:highlight_fields] diff --git a/app/views/advanced/_advanced_search_form.html.erb b/app/views/advanced/_advanced_search_form.html.erb new file mode 100644 index 00000000..1b78d6db --- /dev/null +++ b/app/views/advanced/_advanced_search_form.html.erb @@ -0,0 +1,42 @@ +<% unless (search_context_str = render_search_to_s( advanced_search_context)).blank? %> +
+

<%= t 'blacklight_advanced_search.form.search_context' %>

+ <%= search_context_str %> +
+<% end %> + +<%= form_tag search_catalog_path, :class => 'advanced form-horizontal', :method => :get do %> + + <%= render_hash_as_hidden_fields(advanced_search_context) %> + +
+ +
+

+ <%= t('blacklight_advanced_search.form.query_criteria_heading_html', :select_menu => select_menu_for_field_operator ) %> +

+ + +
+ +
+ +
+ <%= label_tag "publication_date", :class => "col-sm-3 control-label" do %> + Publication Year + <% end %> + +
+ <%= render_range_input("pub_date_sort", :begin) %> - <%= render_range_input("pub_date_sort", :end) %> +
+
+ +
+ +
+ <%= render 'advanced_search_submit_btns' %> +
+ +<% end %> \ No newline at end of file diff --git a/app/views/catalog/_search_form.html.erb b/app/views/catalog/_search_form.html.erb index ba026182..10c0d72f 100644 --- a/app/views/catalog/_search_form.html.erb +++ b/app/views/catalog/_search_form.html.erb @@ -15,6 +15,7 @@ <% end %> + <%#= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", id: "q", autocomplete: presenter.autocomplete_enabled? ? "off" : "", autofocus: presenter.autofocus?, data: { autocomplete_enabled: presenter.autocomplete_enabled?, autocomplete_path: search_action_path(action: :suggest) } %> <%= text_field_tag :q, params[:q], placeholder: t('blacklight.search.form.search.placeholder'), class: "search-q q form-control rounded-#{search_fields.length > 1 ? '0' : 'left'}", id: "q", aria: { label: 'search' }, autocomplete: presenter.autocomplete_enabled? ? "off" : "", autofocus: presenter.autofocus?, data: { autocomplete_enabled: presenter.autocomplete_enabled?, autocomplete_path: search_action_path(action: :suggest) } %> @@ -25,3 +26,9 @@ <% end %> + + + +
+ <%= link_to 'More Options', blacklight_advanced_search_engine.advanced_search_path(search_state.to_h), class: 'advanced_search btn btn-secondary'%> +
diff --git a/config/routes.rb b/config/routes.rb index 925fbcf5..9a4759a8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -9,6 +9,8 @@ end mount Blacklight::Engine => '/' + mount BlacklightAdvancedSearch::Engine => '/' + root to: "catalog#index" concern :searchable, Blacklight::Routes::Searchable.new diff --git a/spec/controllers/catalog_controller_spec.rb b/spec/controllers/catalog_controller_spec.rb index ad7e364d..d1e7b513 100644 --- a/spec/controllers/catalog_controller_spec.rb +++ b/spec/controllers/catalog_controller_spec.rb @@ -12,7 +12,7 @@ let(:search_fields) { controller.blacklight_config.search_fields.keys } let(:expected_search_fields) do - ['all_fields', 'author_tesim', 'orbisBibId_ssi', 'subjectName_ssim', 'title_tesim'] + ['all_fields', 'all_fields_advanced', 'author_tesim', 'identifierShelfMark_tesim', 'oid_ssi', 'orbisBibId_ssi', 'subjectName_ssim', 'title_tesim'] end it { expect(search_fields).to contain_exactly(*expected_search_fields) } diff --git a/spec/support/solr_documents/advanced_search_testing_only.rb b/spec/support/solr_documents/advanced_search_testing_only.rb new file mode 100644 index 00000000..5900f957 --- /dev/null +++ b/spec/support/solr_documents/advanced_search_testing_only.rb @@ -0,0 +1,157 @@ +# frozen_string_literal: true +ADVANCED_SEARCH_TESTING_1 = { + "id": "1", + "abstract_tesim": ["Incomplete at beginning and end.", + "The tale of Sindbād and his princely pupil, in colloquial Arabic."], + "author_ssim": ["Me and Frederick"], + "author_tesim": ["Me and Frederick"], + "alternativeTitle_tesim": ["Book of Sindbad.", + "Sindbad the sailor"], + "collectionId_ssim": ["1"], + "collectionId_tesim": ["1"], + "contents_tesim": ["A few leaves supplied in a later hand.", + "Fair modern (18th century?) naskhī, in red and black.", + "Islamic binding, paper covered, with flap."], + "date_ssim": ["[17--?]"], + "dateStructured_ssim": ["1700-00-00T00:00:00Z"], + "dependentUris_ssim": ["/ladybird/oid/11607445"], + "description_tesim": ["A few leaves supplied in a later hand.", + "Fair modern (18th century?) naskhī, in red and black.", + "Islamic binding, paper covered, with flap."], + "extent_ssim": ["81 leaves ; 20.5 x 14.5 cm."], + "extentOfDigitization_ssim": ["Complete work digitized."], + "format": ["mixed material"], + "identifierShelfMark_ssim": ["Landberg MSS 596"], + "identifierShelfMark_tesim": ["Landberg MSS 596"], + "imageCount_isi": 85, + "indexedBy_tsim": ["Brockelmann, S I, pp. 237, 239, 252."], + "oid_ssi": "11607445", + "orbisBibId_ssi": "3832098", + "partOf_tesim": ["Beinecke Library"], + "partOf_ssim": ["Beinecke Library"], + "public_bsi": true, + "recordType_ssi": "oid", + "references_tesim": ["Brockelmann, S I, pp. 237, 239, 252."], + "repository_ssim": ["Beinecke Library"], + "rights_ssim": ["The use of this image may be subject to the copyright law of the United States (Title 17, United States Code) or to site license or other rights management terms and conditions. The person using the image is liable for any infringement."], + "rights_tesim": ["The use of this image may be subject to the copyright law of the United States (Title 17, United States Code) or to site license or other rights management terms and conditions. The person using the image is liable for any infringement."], + "source_ssim": ["ladybird"], + "subjectEra_ssim": ["Islamic binding"], + "subjectTitle_tsim": ["Islamic binding"], + "subjectTitleDisplay_tsim": ["Arabic language and literature--Belles lettres", + "Islamic binding"], + "subjectName_ssim": ["Computer Science"], + "subjectName_tesim": ["Computer Science"], + "subjectTopic_tesim": ["Arabic language and literature--Belles lettres", + "Islamic binding"], + "subjectTopic_ssim": ["Arabic language and literature--Belles lettres", + "Islamic binding"], + "title_tesim": ["Record 1"], + "uri_ssim": ["/ladybird/oid/11607445"], + "visibility_ssi": "Public", + "abstract_ssim": ["Incomplete at beginning and end.", + "The tale of Sindbād and his princely pupil, in colloquial Arabic."], + "alternativeTitle_ssim": ["Book of Sindbad.", + "Sindbad the sailor"], + "date_tsim": ["[17--?]"], + "oid_ssim": ["11607445"], + "orbisBibId_ssim": ["3832098"], + "recordType_ssim": ["oid"], + "references_ssim": ["Brockelmann, S I, pp. 237, 239, 252."], + "subject_topic_tsim": ["Arabic language and literature--Belles lettres", + "Islamic binding"], + "title_tsim": ["Record 1"] +}.freeze + +ADVANCED_SEARCH_TESTING_2 = { + "id": "2", + "abstract_tesim": ["Manuscript on parchment of Jacopo Zeno, Vita Caroli Zeni. With a dedicatory preface to Pope Pius II. This manuscript is of special importance because it contains the complete work."], + "author_ssim": ["Zeno, Jacopo, 1417-1481"], + "author_tesim": ["Zeno, Jacopo, 1417-1481"], + "collectionId_ssim": ["1"], + "collectionId_tesim": ["1"], + "contents_tesim": ["Binding: Eighteenth century. Brownish-red goatskin, gold-tooled; pale green and gold, Dutch gilt paper boards.", + "On f. 1r, a foliage border which includes hares, stork, vase, and arms of the Piccolomini family (argent, a cross azur with 5 crescents or; surmounted by keys in saltire argent and a papal tiara; supported by a pair of angels). Eleven elaborate initials, 11- to 7-line, in gold, red, blue, and green entwined with foliage. The style of decoration is decidedly Roman.", + "Purchased by William Loring Andrews who presented it to Yale in 1894.", + "Script: Written in humanistic script by Franciscus de Tianis of Pistoia."], + "contributor_tsim": ["Zeno, Carlo,--1334-1418", + "Zeno, Jacopo,--1417-1481"], + "contributorDisplay_tsim": ["Zeno, Carlo,--1334-1418", + "Zeno, Jacopo,--1417-1481"], + "creatorDisplay_tsim": ["Zeno, Jacopo, 1417-1481"], + "date_ssim": ["[ca. 1458]"], + "dateStructured_ssim": ["1458-00-00T00:00:00Z"], + "dependentUris_ssim": ["/ladybird/oid/11684565"], + "description_tesim": ["Binding: Eighteenth century. Brownish-red goatskin, gold-tooled; pale green and gold, Dutch gilt paper boards.", + "On f. 1r, a foliage border which includes hares, stork, vase, and arms of the Piccolomini family (argent, a cross azur with 5 crescents or; surmounted by keys in saltire argent and a papal tiara; supported by a pair of angels). Eleven elaborate initials, 11- to 7-line, in gold, red, blue, and green entwined with foliage. The style of decoration is decidedly Roman.", + "Purchased by William Loring Andrews who presented it to Yale in 1894.", + "Script: Written in humanistic script by Franciscus de Tianis of Pistoia."], + "extent_ssim": ["ff. ii + 192 + i : parchment ; 271 x 177 (177 x 106) mm."], + "extentOfDigitization_ssim": ["Complete work digitized."], + "format": ["mixed material"], + "genre_ssim": ["Decorated initials", + "Manuscripts"], + "identifierShelfMark_ssim": ["Beinecke MS 2"], + "identifierShelfMark_tesim": ["Beinecke MS 2"], + "imageCount_isi": 398, + "indexedBy_tsim": ["Jacopo Zeno, Vita Caroli Zeni. General Collection, Beinecke Rare Book and Manuscript Library, Yale University.", + "Shailor, B. Catalogue of Medieval and Renaissance Manuscripts in the Beinecke Rare Book and Manuscript Library, MS 2."], + "language_ssim": ["Latin"], + "oid_ssi": "11684565", + "orbisBarcode_ssi": "39002091594300", + "orbisBibId_ssi": "9801995", + "partOf_tesim": ["Beinecke Library"], + "partOf_ssim": ["Beinecke Library"], + "public_bsi": true, + "publicationPlace_ssim": ["Italy,"], + "publicationPlace_tesim": ["Italy,"], + "recordType_ssi": "oid", + "references_tesim": ["Jacopo Zeno, Vita Caroli Zeni. General Collection, Beinecke Rare Book and Manuscript Library, Yale University.", + "Shailor, B. Catalogue of Medieval and Renaissance Manuscripts in the Beinecke Rare Book and Manuscript Library, MS 2."], + "repository_ssim": ["Beinecke Library"], + "resourceType_ssim": ["Archives or Manuscripts"], + "resourceType_tesim": ["Archives or Manuscripts"], + "rights_ssim": ["The use of this image may be subject to the copyright law of the United States (Title 17, United States Code) or to site license or other rights management terms and conditions. The person using the image is liable for any infringement."], + "rights_tesim": ["The use of this image may be subject to the copyright law of the United States (Title 17, United States Code) or to site license or other rights management terms and conditions. The person using the image is liable for any infringement."], + "source_ssim": ["ladybird"], + "subjectEra_ssim": ["Medieval and Renaissance Manuscripts in Beinecke Library"], + "subjectTitle_tsim": ["Medieval and Renaissance Manuscripts in Beinecke Library"], + "subjectTitleDisplay_tsim": ["Biography--Middle Ages, 500-1500", + "Crusades--13th-15th centuries", + "Illumination of books and manuscripts, Medieval", + "Manuscripts, Medieval--Connecticut--New Haven", + "Medieval and Renaissance Manuscripts in Beinecke Library"], + "subjectName_ssim": ["Zeno, Carlo,--1334-1418", + "Zeno, Jacopo,--1417-1481"], + "subjectName_tesim": ["Zeno, Carlo,--1334-1418", + "Zeno, Jacopo,--1417-1481"], + "subjectTopic_tesim": ["Biography--Middle Ages, 500-1500", + "Crusades--13th-15th centuries", + "Illumination of books and manuscripts, Medieval", + "Manuscripts, Medieval--Connecticut--New Haven", + "Medieval and Renaissance Manuscripts in Beinecke Library"], + "subjectTopic_ssim": ["Biography--Middle Ages, 500-1500", + "Crusades--13th-15th centuries", + "Illumination of books and manuscripts, Medieval", + "Manuscripts, Medieval--Connecticut--New Haven", + "Medieval and Renaissance Manuscripts in Beinecke Library"], + "title_tesim": ["Record 2"], + "uri_ssim": ["/ladybird/oid/11684565"], + "url_suppl_ssim": ["https://pre1600ms.beinecke.library.yale.edu/docs/pre1600.ms002.htm"], + "visibility_ssi": "Public", + "abstract_ssim": ["Manuscript on parchment of Jacopo Zeno, Vita Caroli Zeni. With a dedicatory preface to Pope Pius II."], + "author_tsim": ["Zeno, Jacopo, 1417-1481"], + "date_tsim": ["[ca. 1458]"], + "oid_ssim": ["11684565"], + "orbisBarcode_ssim": ["39002091594300"], + "orbisBibId_ssim": ["9801995"], + "recordType_ssim": ["oid"], + "references_ssim": ["Jacopo Zeno, Vita Caroli Zeni. General Collection, Beinecke Rare Book and Manuscript Library, Yale University.", + "Shailor, B. Catalogue of Medieval and Renaissance Manuscripts in the Beinecke Rare Book and Manuscript Library, MS 2."], + "subject_topic_tsim": ["Biography--Middle Ages, 500-1500", + "Crusades--13th-15th centuries", + "Illumination of books and manuscripts, Medieval", + "Manuscripts, Medieval--Connecticut--New Haven", + "Medieval and Renaissance Manuscripts in Beinecke Library"], + "title_tsim": ["Record 2"] +}.freeze diff --git a/spec/system/advanced_search_spec.rb b/spec/system/advanced_search_spec.rb new file mode 100644 index 00000000..c082d7e9 --- /dev/null +++ b/spec/system/advanced_search_spec.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'Search the catalog using advanced search', type: :system, js: true, clean: true do + before do + solr = Blacklight.default_index.connection + solr.add([dog, cat]) + solr.commit + end + + let(:dog) { ADVANCED_SEARCH_TESTING_1 } + + let(:cat) { ADVANCED_SEARCH_TESTING_2 } + + it 'gets correct search results from all fields' do + visit root_path + click_on "More Options" + # Search for something + fill_in 'all_fields_advanced', with: 'Record 1' + click_on 'advanced-search-submit' + + within '#documents' do + expect(page).to have_content('Record 1') + expect(page).not_to have_content('Record 2') + end + end + it 'gets correct search results from author_tesim' do + visit root_path + click_on 'More Options' + # Search for something + fill_in 'author_tesim', with: 'Me and Frederick' + click_on 'advanced-search-submit' + within '#documents' do + expect(page).to have_content('Record 1') + expect(page).not_to have_content('Record 2') + end + end + it 'gets correct search results from identifierShelfMark_tesim' do + visit root_path + click_on 'More Options' + # Search for something + fill_in 'identifierShelfMark_tesim', with: '["Landberg MSS 596"]' + click_on 'advanced-search-submit' + within '#documents' do + expect(page).to have_content('Record 1') + expect(page).not_to have_content('Record 2') + end + end + it 'gets correct search results from orbisBibId_ssi' do + visit root_path + click_on 'More Options' + # Search for something + fill_in 'orbisBibId_ssi', with: '3832098' + click_on 'advanced-search-submit' + within '#documents' do + expect(page).to have_content('Record 1') + expect(page).not_to have_content('Record 2') + end + end + it 'gets correct search results from title_tesim' do + visit root_path + click_on 'More Options' + # Search for something + fill_in 'title_tesim', with: '["Record 1"]' + click_on 'advanced-search-submit' + within '#documents' do + expect(page).to have_content('Record 1') + expect(page).not_to have_content('Record 2') + end + end + it 'gets correct search results from oid_ssi' do + visit root_path + click_on 'More Options' + # Search for something + fill_in 'oid_ssi', with: '11607445' + click_on 'advanced-search-submit' + within '#documents' do + expect(page).to have_content('Record 1') + expect(page).not_to have_content('Record 2') + end + end +end diff --git a/spec/system/search_fields_spec.rb b/spec/system/search_fields_spec.rb index 08e3fadf..2a19268b 100644 --- a/spec/system/search_fields_spec.rb +++ b/spec/system/search_fields_spec.rb @@ -11,7 +11,7 @@ let(:search_fields) { CatalogController.blacklight_config.search_fields.keys } let(:expected_search_fields) do - ["all_fields", "author_tesim", "orbisBibId_ssi", "subjectName_ssim", "title_tesim"] + ['all_fields', 'all_fields_advanced', 'author_tesim', 'identifierShelfMark_tesim', 'oid_ssi', 'orbisBibId_ssi', 'subjectName_ssim', 'title_tesim'] end let(:dog) do