Skip to content

Instantly share code, notes, and snippets.

@cfitz
Created August 10, 2016 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfitz/3854c7e1ce275ba5bc121739aca38848 to your computer and use it in GitHub Desktop.
Save cfitz/3854c7e1ce275ba5bc121739aca38848 to your computer and use it in GitHub Desktop.
fixes fullrecord indexing in 1.5.1
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
@cfitz
Copy link
Author

cfitz commented Aug 10, 2016

add this to plugins/local/indexer/indexer.rb and restart.

@cfitz
Copy link
Author

cfitz commented Aug 11, 2016

Oh, and you have to reindex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment