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

fix: replace combined_subject field for searching with all subject fields #1130

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ class CatalogController < ApplicationController
pf: ''
}
end
config.add_search_field('combined_subject_ssim', label: 'Subject') do |field|
config.add_search_field('subject_tesim subject_topic_tesim subject_geographic_tesim subject_temporal_tesim', label: 'Subject') do |field|
field.solr_parameters = {
qf: 'combined_subject_ssim',
qf: 'subject_tesim subject_topic_tesim subject_geographic_tesim subject_temporal_tesim',
pf: ''
}
end
Expand Down
5 changes: 4 additions & 1 deletion app/services/search_field_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ class SearchFieldService
'scribe_tesim',
'script_tesim',
'series_tesim',
'combined_subject_ssim',
'subject_tesim',
'subject_topic_tesim',
'subject_geographic_tesim',
'subject_temporal_tesim',
'summary_tesim',
'support_tesim',
'title_tesim',
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/e2e/ursus_search.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Search', () => {
it('Search Subject Found', () => {
cy.visit('/');
cy.get('[id=q]').type('engineer');
cy.get('select').select('Subject').should('have.value', 'combined_subject_ssim');
cy.get('select').select('Subject').should('have.value', 'subject_tesim subject_topic_tesim subject_geographic_tesim subject_temporal_tesim');
cy.get('[id=search]').click();
cy.get('.search-count__heading').contains('Catalog Results');
cy.percySnapshot();
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/catalog_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
let(:search_fields) { controller.blacklight_config.search_fields.keys }

let(:expected_search_fields) do
['all_fields', 'combined_subject_ssim', 'title_tesim']
['all_fields', 'subject_tesim subject_topic_tesim subject_geographic_tesim subject_temporal_tesim', 'title_tesim']
end

it { expect(search_fields).to contain_exactly(*expected_search_fields) }
Expand Down
2 changes: 1 addition & 1 deletion spec/services/search_field_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
RSpec.describe SearchFieldService do
let(:search_field_service) { described_class.instance }
it 'returns the correct list of search fields' do
expect(search_field_service.search_fields).to eq(['ark_ssi', 'artist_tesim', 'alternative_title_tesim', 'architect_tesim', 'author_tesim', 'binding_note_tesim', 'caption_tesim', 'collation_tesim', 'colophon_tesim', 'composer_tesim', 'condition_note_ssi', 'contents_note_tesim', 'contributor_tesim', 'creator_tesim', 'date_created_tesim', 'description_tesim', 'explicit_tesim', 'features_tesim', 'foliation_tesim', 'genre_tesim', 'human_readable_language_tesim', 'identifier_tesim', 'illuminator_tesim', 'illustrations_note_tesim', 'inscription_tesim', 'incipit_tesim', 'local_identifier_ssim', 'location_tesim', 'lyricist_tesim', 'medium_tesim', 'named_subject_tesim', 'page_layout_ssim', 'opac_url_ssi', 'page_layout_ssim', 'photographer_tesim', 'place_of_origin_tesim', 'producer_tesim', 'provenance_tesim', 'publisher_tesim', 'scribe_tesim', 'script_tesim', 'series_tesim', 'combined_subject_ssim', 'summary_tesim', 'support_tesim', 'title_tesim', 'toc_tesim', 'uniform_title_tesim', 'hand_note_tesim', 'writing_system_tesim', 'uniform_title_tesim', 'shelfmark_ssi', 'descriptive_title_tesim', 'delivery_tesim', 'other_versions_tesim', 'repository_tesim', 'host_tesim', 'musician_tesim', 'printer_tesim', 'researcher_tesim', 'format_book_tesim', 'resp_statement_tesim', 'citation_source_tesim'].join(' '))
expect(search_field_service.search_fields).to eq(['ark_ssi', 'artist_tesim', 'alternative_title_tesim', 'architect_tesim', 'author_tesim', 'binding_note_tesim', 'caption_tesim', 'collation_tesim', 'colophon_tesim', 'composer_tesim', 'condition_note_ssi', 'contents_note_tesim', 'contributor_tesim', 'creator_tesim', 'date_created_tesim', 'description_tesim', 'explicit_tesim', 'features_tesim', 'foliation_tesim', 'genre_tesim', 'human_readable_language_tesim', 'identifier_tesim', 'illuminator_tesim', 'illustrations_note_tesim', 'inscription_tesim', 'incipit_tesim', 'local_identifier_ssim', 'location_tesim', 'lyricist_tesim', 'medium_tesim', 'named_subject_tesim', 'page_layout_ssim', 'opac_url_ssi', 'page_layout_ssim', 'photographer_tesim', 'place_of_origin_tesim', 'producer_tesim', 'provenance_tesim', 'publisher_tesim', 'scribe_tesim', 'script_tesim', 'series_tesim', 'subject_tesim', 'subject_topic_tesim', 'subject_geographic_tesim', 'subject_temporal_tesim', 'summary_tesim', 'support_tesim', 'title_tesim', 'toc_tesim', 'uniform_title_tesim', 'hand_note_tesim', 'writing_system_tesim', 'uniform_title_tesim', 'shelfmark_ssi', 'descriptive_title_tesim', 'delivery_tesim', 'other_versions_tesim', 'repository_tesim', 'host_tesim', 'musician_tesim', 'printer_tesim', 'researcher_tesim', 'format_book_tesim', 'resp_statement_tesim', 'citation_source_tesim'].join(' '))
end
end
Loading