Skip to content
This repository has been archived by the owner on May 14, 2022. It is now read-only.

Commit

Permalink
Removes additional unused fields from search results
Browse files Browse the repository at this point in the history
  • Loading branch information
tampakis committed May 3, 2017
1 parent d0b57ba commit 6c3a8ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
13 changes: 2 additions & 11 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def self.modified_field
# solr fields that will be treated as facets by the blacklight application
# The ordering of the field names is the order of the display
config.add_facet_field solr_name('human_readable_type', :facetable)
config.add_facet_field solr_name('tag', :facetable), limit: 5
config.add_facet_field solr_name('subject', :facetable), limit: 5
config.add_facet_field solr_name('language', :facetable), limit: 5
config.add_facet_field solr_name('based_near', :facetable), limit: 5
Expand All @@ -59,20 +58,12 @@ def self.modified_field

# solr fields to be displayed in the index (search results) view
# The ordering of the field names is the order of the display
config.add_index_field solr_name('tag', :stored_searchable)
config.add_index_field solr_name('creator', :stored_searchable)
config.add_index_field solr_name('contributor', :stored_searchable)
config.add_index_field solr_name('publisher', :stored_searchable)
config.add_index_field solr_name('based_near', :stored_searchable)
config.add_index_field solr_name('language', :stored_searchable) do |field|
field.accessor = :language_display
end
config.add_index_field solr_name('date_uploaded', :stored_sortable)
config.add_index_field solr_name('date_modified', :stored_sortable)
config.add_index_field solr_name('date', :stored_searchable)
config.add_index_field solr_name('human_readable_type', :stored_searchable)
config.add_index_field solr_name('format', :stored_searchable)
config.add_index_field solr_name('source_metadata_identifier', :stored_searchable), label: 'Bib ID'
config.add_index_field solr_name('identifier', :stored_searchable)
config.add_index_field solr_name('member_of_collections', :symbol), label: 'Collection'

# "fielded" search configuration. Used by pulldown among other places.
# For supported keys in hash, see rdoc for Blacklight::SearchFields
Expand Down
18 changes: 0 additions & 18 deletions spec/features/catalog_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@
end
end

describe "language and date formatting" do
let(:user) { FactoryGirl.create(:admin) }
let(:scanned_resource) { FactoryGirl.create(:complete_scanned_resource, user: user, language: ['deu'], date_created: ['1941-10-23T00:00:00Z'], date: ['10/23/1941']) }

before(:each) do
sign_in user
scanned_resource.update_index
end

scenario "formatted versions are displayed" do
visit search_catalog_path q: ""
expect(page).to have_text 'German'
expect(page).to_not have_text 'deu'
expect(page).to have_text '10/23/1941'
expect(page).to_not have_text '1941-10-23'
end
end

describe "searching by identifiers and other metadata" do
let(:user) { FactoryGirl.create(:admin) }
let(:scanned_resource) { FactoryGirl.create(:complete_scanned_resource, user: user, title: ['This is a persimmon title'], creator: ['Smithee, Al'], replaces: ['pudl8675/309'], identifier: ['ark:/99999/p12345678'], call_number: ['998y']) }
Expand Down

0 comments on commit 6c3a8ca

Please sign in to comment.