Skip to content

Commit

Permalink
Merge pull request #5 from hudmol/archival-object-title-for-empty-test
Browse files Browse the repository at this point in the history
Add archival_object_title_u_utext SOLR field
  • Loading branch information
jambun authored Jan 19, 2017
2 parents 0c168f4 + 448ad6f commit 00ba497
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ en:
user_defined_text_4: Plating Information
user_defined_text_5: Bibliographic Citation
accession_title: Accession Title
archival_object_title: Archival Object Title
date:
accession_date: Accession Date
date_begin: Begin
Expand Down
7 changes: 7 additions & 0 deletions indexer/common_indexer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ class CommonIndexer
end
}

# Index extra Archival Object fields
indexer.add_document_prepare_hook {|doc, record|
if doc['primary_type'] == 'archival_object'
doc['archival_object_title_u_utext'] = record['record']['title']
end
}

# Index extra fields for all records
indexer.add_document_prepare_hook {|doc, record|
# linked agent roles
Expand Down
10 changes: 10 additions & 0 deletions migrations/006_reindex_all_archival_objects.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Sequel.migration do

up do
[:archival_object].each do |table|
self[table].update(:system_mtime => Time.now)
end
end

end

1 change: 1 addition & 0 deletions search_definitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
AdvancedSearch.define_field(:name => 'user_defined_text_5', :type => :text, :visibility => [:staff], :solr_field => 'text_5_u_utext')
AdvancedSearch.define_field(:name => 'collection_management_processors', :type => :text, :visibility => [:staff], :solr_field => 'collection_management_processors_u_utext')
AdvancedSearch.define_field(:name => 'accession_title', :type => :text, :visibility => [:staff], :solr_field => 'accession_title_u_utext')
AdvancedSearch.define_field(:name => 'archival_object_title', :type => :text, :visibility => [:staff], :solr_field => 'archival_object_title_u_utext')

LinkedAgentFields::LINKED_AGENT_INDEXED_ROLES.each do |role|
AdvancedSearch.define_field(:name => "agents_#{role}_role", :type => :text, :visibility => [:staff], :solr_field => "agents_text_#{role}_role_u_utext")
Expand Down

0 comments on commit 00ba497

Please sign in to comment.