/
solr_document.rb
31 lines (26 loc) · 1.37 KB
/
solr_document.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- encoding : utf-8 -*-
class SolrDocument
include Blacklight::Solr::Document
# The following shows how to setup this blacklight document to display marc documents
extension_parameters[:marc_source_field] = :marc_display
extension_parameters[:marc_format_type] = :marcxml
use_extension( Blacklight::Solr::Document::Marc) do |document|
document.key?( :marc_display )
end
# Email uses the semantic field mappings below to generate the body of an email.
SolrDocument.use_extension( Blacklight::Solr::Document::Email )
# SMS uses the semantic field mappings below to generate the body of an SMS email.
SolrDocument.use_extension( Blacklight::Solr::Document::Sms )
# DublinCore uses the semantic field mappings below to assemble an OAI-compliant Dublin Core document
# Semantic mappings of solr stored fields. Fields may be multi or
# single valued. See Blacklight::Solr::Document::ExtendableClassMethods#field_semantics
# and Blacklight::Solr::Document#to_semantic_values
# Recommendation: Use field names from Dublin Core
use_extension( Blacklight::Solr::Document::DublinCore)
field_semantics.merge!(
:title => "title_display",
:author => "author_display",
:language => "language_facet",
:format => "format"
)
end