Skip to content

Commit

Permalink
Merge pull request #113 from scientist-softserv/i77-metadata-search
Browse files Browse the repository at this point in the history
πŸ› Add terms to search fields
  • Loading branch information
kirkkwang authored Aug 8, 2024
2 parents 0702cdd + 3cda90f commit 92c85a1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/controllers/catalog_controller_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def self.uploaded_field
config.show_fields.clear

config.add_show_field solr_name("title", :stored_searchable)
config.add_show_field solr_name("abstract", :stored_searchable)
config.add_show_field solr_name('admin_note', :stored_searchable), label: "Administrative Notes"
config.add_show_field solr_name("alternative_title", :stored_searchable), label: "Alternative title"
config.add_show_field solr_name("creator", :stored_searchable)
Expand Down Expand Up @@ -154,6 +155,16 @@ def self.uploaded_field
end
end

config.search_fields['all_fields'].clear
config.add_search_field('all_fields', label: 'All Fields', include_in_advanced_search: false) do |field|
all_names = config.show_fields.values.map(&:field).join(" ")
title_name = 'title_tesim'
field.solr_parameters = {
qf: "#{all_names} file_format_tesim all_text_timv",
pf: title_name.to_s
}
end

# If there is something additional about a search field that needs to be customized i.e. whether to include in advanced search, or if it needs a different solr name, add it below
config.search_fields.delete('date')
config.add_search_field('date') do |field|
Expand Down

0 comments on commit 92c85a1

Please sign in to comment.