dor-services 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dor/models/describable.rb +14 -13
- data/lib/dor/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f18cae14cad4e7d46c99fd2805fb8517ef0d4020
|
4
|
+
data.tar.gz: 853c360a25789be6c4d541e20ddd5f875bf9aaca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06e4ded70b6d91f0751240b1b122260c6ac0d7994405e9e37b2192e83655235ad807d377a80114449ef3db79741b3d4084cc373d88bee1a495670fbed16822ac
|
7
|
+
data.tar.gz: 1624211169fdcfb9f7da970bb614a0f5e3d9704f9e551acde3d497c4f22b178f8c5a8c92c7aade636cf10c4fdf03387aba196b2d178029a4d8688ff90da665c0
|
@@ -157,10 +157,17 @@ module Dor
|
|
157
157
|
|
158
158
|
def to_solr(solr_doc=Hash.new, *args)
|
159
159
|
super solr_doc, *args
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
160
|
+
mods_sources = {
|
161
|
+
'sw_language_tesim' => :sw_language_facet,
|
162
|
+
'sw_genre_tesim' => :sw_genre,
|
163
|
+
'sw_format_tesim' => :format_main, # basically sw_typeOfResource_tesim
|
164
|
+
'sw_subject_temporal_tesim' => :era_facet,
|
165
|
+
'sw_subject_geographic_tesim' => :geographic_facet,
|
166
|
+
'mods_typeOfResource_tesim' => [:term_values, :typeOfResource]
|
167
|
+
}
|
168
|
+
keys = mods_sources.keys.concat(%w[ metadata_format_ssim ])
|
169
|
+
keys.each { |key|
|
170
|
+
solr_doc[key] ||= [] # initialize multivalue targts if necessary
|
164
171
|
}
|
165
172
|
|
166
173
|
solr_doc["metadata_format_ssim"] << self.metadata_format
|
@@ -185,15 +192,7 @@ module Dor
|
|
185
192
|
|
186
193
|
begin
|
187
194
|
mods = self.stanford_mods
|
188
|
-
|
189
|
-
'sw_language_tesim' => :sw_language_facet,
|
190
|
-
'sw_genre_tesim' => :sw_genre,
|
191
|
-
'sw_format_tesim' => :format_main, # basically sw_typeOfResource_tesim
|
192
|
-
'sw_subject_temporal_tesim' => :era_facet,
|
193
|
-
'sw_subject_geographic_tesim' => :geographic_facet,
|
194
|
-
'mods_typeOfResource_tesim' => [:term_values, :typeOfResource]
|
195
|
-
}
|
196
|
-
sources.each_pair do |solr_key, meth|
|
195
|
+
mods_sources.each_pair do |solr_key, meth|
|
197
196
|
vals = meth.is_a?(Array) ? mods.send(meth.shift, *meth) : mods.send(meth)
|
198
197
|
solr_doc[solr_key].push *vals unless (vals.nil? || vals.empty?)
|
199
198
|
# asterisk to avoid multi-dimensional array: push values, not the array
|
@@ -202,6 +201,8 @@ module Dor
|
|
202
201
|
end
|
203
202
|
# some fields get explicit "(none)" placeholder values, mostly for faceting
|
204
203
|
%w[sw_language_tesim sw_genre_tesim sw_format_tesim].each { |key| solr_doc[key] = ['(none)'] if solr_doc[key].empty? }
|
204
|
+
# otherwise remove empties
|
205
|
+
keys.each{ |key| solr_doc.delete(key) if (solr_doc[key].nil? || solr_doc[key].empty?)}
|
205
206
|
solr_doc
|
206
207
|
end
|
207
208
|
|
data/lib/dor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2015-03-
|
15
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: active-fedora
|
@@ -174,14 +174,14 @@ dependencies:
|
|
174
174
|
requirements:
|
175
175
|
- - "~>"
|
176
176
|
- !ruby/object:Gem::Version
|
177
|
-
version: 1.
|
177
|
+
version: '1.7'
|
178
178
|
type: :runtime
|
179
179
|
prerelease: false
|
180
180
|
version_requirements: !ruby/object:Gem::Requirement
|
181
181
|
requirements:
|
182
182
|
- - "~>"
|
183
183
|
- !ruby/object:Gem::Version
|
184
|
-
version: 1.
|
184
|
+
version: '1.7'
|
185
185
|
- !ruby/object:Gem::Dependency
|
186
186
|
name: rsolr-ext
|
187
187
|
requirement: !ruby/object:Gem::Requirement
|