Created
August 10, 2016 11:30
-
-
Save cfitz/3854c7e1ce275ba5bc121739aca38848 to your computer and use it in GitHub Desktop.
fixes fullrecord indexing in 1.5.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CommonIndexer | |
add_indexer_initialize_hook do |indexer| | |
indexer.add_document_prepare_hook do |doc, record| | |
doc['fullrecord'] = CommonIndexer.extract_string_values(record) | |
%w(finding_aid_subtitle finding_aid_author).each do |field| | |
if record['record'].has_key?(field) | |
doc['fullrecord'] << "#{record['record'][field]} " | |
end | |
end | |
if record['record'].has_key?('names') | |
doc['fullrecord'] << record['record']['names'].map {|name| | |
CommonIndexer.extract_string_values(name) | |
}.join(" ") | |
end | |
end | |
end | |
end |
Oh, and you have to reindex.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add this to plugins/local/indexer/indexer.rb and restart.