spotlight-dor-resources 0.6.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +7 -7
- data/lib/spotlight/dor/indexer.rb +3 -3
- data/lib/spotlight/dor/resources/version.rb +1 -1
- data/spec/lib/spotlight/dor/indexer_spec.rb +1 -1
- data/spotlight-dor-resources.gemspec +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: c1c36106b2008109449362c180ae930b0c2ed8fb
|
4
|
+
data.tar.gz: b53aa8267ae171222b5bed3c5f2569a936196b22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1aaf989efd1f2bf22a6cf916e0a3e2132ae3460222a2f7b5484bd582a9129c049da46dfb33ad2dc678e3ac3710ad2c79abeffe78c80ef43f4a31e0935f96b014
|
7
|
+
data.tar.gz: d3a97d019c8efcfcf23993fccf2293e0bf375e32b22d6402ac306d1562709fd7b0d790943d0a03ad5d8eee7d0f88721a3286a2472249c9db5d7fefecc34ac431
|
data/README.md
CHANGED
@@ -48,20 +48,20 @@ This will download a test jetty instance (to run Solr), generate a testing app a
|
|
48
48
|
```ruby
|
49
49
|
druid="ty202yt2402" # a feigenbaum druid
|
50
50
|
druid="cx709ty7769" # a revs druid
|
51
|
-
purl=Spotlight::Resources::
|
51
|
+
purl=Spotlight::Resources::DorHarvester.new(druid_list: druid)
|
52
52
|
purl.exhibit=Spotlight::Exhibit.new # need an exhibit to attach the test solr docs too
|
53
53
|
purl.exhibit.title='stanford'
|
54
54
|
purl.exhibit.save
|
55
55
|
|
56
56
|
puts purl.to_solr.first # the solr document as a hash
|
57
|
-
public_xml=purl.
|
58
|
-
mods=purl.
|
59
|
-
smods_rec=purl.
|
57
|
+
public_xml=purl.resources[0].public_xml # nokogiri doc with all public XML
|
58
|
+
mods=purl.resources[0].mods # nokogiri doc with just the MODs
|
59
|
+
smods_rec=purl.resources[0].smods_rec # a Stanford::Mods::Record Object (which inherits from the MODS gem)
|
60
60
|
|
61
|
-
puts purl.
|
62
|
-
puts purl.
|
61
|
+
puts purl.resources[0].bare_druid # will not have the "druid:" prefix
|
62
|
+
puts purl.resources[0].druid # might have the "druid:" prefix (if returned as the result of an is_collection call)
|
63
63
|
|
64
|
-
purl.
|
64
|
+
purl.resources[0].indexer.config.solr.url # the configured solr server (should be localhost in development)
|
65
65
|
|
66
66
|
purl.save # save to database and index to solr
|
67
67
|
purl.reindex # reindex once saved the first time
|
@@ -71,7 +71,7 @@ module Spotlight::Dor
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def add_location(sdb, solr_doc)
|
74
|
-
solr_doc['location_ssi'] = sdb.smods_rec.
|
74
|
+
solr_doc['location_ssi'] = sdb.smods_rec.physical_location_str
|
75
75
|
end
|
76
76
|
|
77
77
|
# add point_bbox solr field containing the point bounding box per
|
@@ -147,7 +147,7 @@ module Spotlight::Dor
|
|
147
147
|
|
148
148
|
def add_document_subtype(sdb, solr_doc)
|
149
149
|
subtype = sdb.smods_rec.note.select { |n| n.displayLabel == 'Document subtype' }.map(&:content)
|
150
|
-
solr_doc['doc_subtype_ssi'] = subtype.first
|
150
|
+
solr_doc['doc_subtype_ssi'] = subtype.first unless subtype.empty?
|
151
151
|
end
|
152
152
|
|
153
153
|
def add_donor_tags(sdb, solr_doc)
|
@@ -178,7 +178,7 @@ module Spotlight::Dor
|
|
178
178
|
# search for configured full text files, and if found, add them to the full text (whole document) solr field
|
179
179
|
def add_object_full_text(sdb, solr_doc)
|
180
180
|
full_text_urls = object_level_full_text_urls(sdb)
|
181
|
-
return if full_text_urls.
|
181
|
+
return if full_text_urls.empty?
|
182
182
|
solr_doc['full_text_tesimv'] = full_text_urls.map { |file_url| get_file_content(file_url) }
|
183
183
|
end
|
184
184
|
|
@@ -531,7 +531,7 @@ describe Spotlight::Dor::Indexer do
|
|
531
531
|
end
|
532
532
|
|
533
533
|
it 'extracts the point_bbox' do
|
534
|
-
expect(solr_doc['point_bbox']).to eq(['ENVELOPE(-16.0, 28.0,
|
534
|
+
expect(solr_doc['point_bbox']).to eq(['ENVELOPE(-16.0, 28.0, 13.0, -15.0)'])
|
535
535
|
end
|
536
536
|
end
|
537
537
|
end # add_point_bbox
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_dependency 'rails'
|
29
29
|
spec.add_dependency 'blacklight-spotlight', '~> 0.16'
|
30
30
|
spec.add_dependency 'parallel'
|
31
|
-
spec.add_dependency 'stanford-mods', '~> 1
|
31
|
+
spec.add_dependency 'stanford-mods', '~> 2.1'
|
32
32
|
spec.add_development_dependency 'bundler', '~> 1.5'
|
33
33
|
spec.add_development_dependency 'rake'
|
34
34
|
spec.add_development_dependency 'rspec'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spotlight-dor-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '1
|
117
|
+
version: '2.1'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '1
|
124
|
+
version: '2.1'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: bundler
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|