dor-services 5.11.1 → 5.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dor/services/indexing_service.rb +23 -7
- data/lib/dor/version.rb +1 -1
- metadata +35 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aff39b53fc6fedf10ff743cb3d278e873283d98
|
4
|
+
data.tar.gz: d1c37b58887fbdc7a2d1c86fe9c689dec9d69023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edfde3b9ce9e74b4ac8956cc147a194287f5c10fba0458851fdef493e73c5ac67cdd0e69e8654e18e602ed832dd5706d20c345eb6ffde7aa31d69148bbdc8c5a
|
7
|
+
data.tar.gz: 805ade0109e6085e67aedb75e47eadfe9c0c9a22a67ce444f0d1502d7cd2a013e733b069ce74c67ef1c8d68d3d43cd57a699baacedd492f6372a921d91252f30
|
@@ -22,14 +22,14 @@ module Dor
|
|
22
22
|
end
|
23
23
|
|
24
24
|
# takes a Dor object and indexes it to solr. doesn't commit automatically.
|
25
|
-
def self.reindex_object(obj)
|
25
|
+
def self.reindex_object(obj, options = {})
|
26
26
|
solr_doc = obj.to_solr
|
27
|
-
Dor::SearchService.solr.add(solr_doc)
|
27
|
+
Dor::SearchService.solr.add(solr_doc, options)
|
28
28
|
solr_doc
|
29
29
|
end
|
30
30
|
|
31
31
|
# retrieves a single Dor object by pid, indexes the object to solr, does some logging
|
32
|
-
# (will use a
|
32
|
+
# (will use a default logger if one is not provided). doesn't commit automatically.
|
33
33
|
#
|
34
34
|
# WARNING/TODO: the tests indicate that the "rescue Exception" block at the end will
|
35
35
|
# get skipped, and the thrown exception (e.g. SystemStackError) will not be logged. since
|
@@ -37,10 +37,26 @@ module Dor
|
|
37
37
|
# doesn't seem worth blocking refactoring. see https://github.com/sul-dlss/dor-services/issues/156
|
38
38
|
# extra logging in this case would be nice, but centralized indexing that's otherwise
|
39
39
|
# fully functional is nicer.
|
40
|
-
|
41
|
-
|
40
|
+
#
|
41
|
+
# @overload reindex_pid(pid, index_logger, options = {})
|
42
|
+
# @overload reindex_pid(pid, index_logger, should_raise_errors, options = {})
|
43
|
+
# @overload reindex_pid(pid, options = {})
|
44
|
+
def self.reindex_pid(pid, *args)
|
45
|
+
options = {}
|
46
|
+
options = args.pop if args.last.is_a? Hash
|
47
|
+
|
48
|
+
if args.length > 0
|
49
|
+
warn "Dor::IndexingService.reindex_pid with primitive arguments is deprecated; pass e.g. { logger: logger, raise_errors: bool } instead"
|
50
|
+
index_logger, should_raise_errors = args
|
51
|
+
index_logger ||= default_index_logger
|
52
|
+
should_raise_errors = true if should_raise_errors.nil?
|
53
|
+
else
|
54
|
+
index_logger = options.fetch(:logger, default_index_logger)
|
55
|
+
should_raise_errors = options.fetch(:raise_errors, true)
|
56
|
+
end
|
57
|
+
|
42
58
|
obj = Dor.load_instance pid
|
43
|
-
solr_doc = reindex_object obj
|
59
|
+
solr_doc = reindex_object obj, options
|
44
60
|
index_logger.info "updated index for #{pid}"
|
45
61
|
solr_doc
|
46
62
|
rescue StandardError => se
|
@@ -57,7 +73,7 @@ module Dor
|
|
57
73
|
|
58
74
|
# given a list of pids, retrieve those objects from fedora, index each to solr, optionally commit
|
59
75
|
def self.reindex_pid_list(pid_list, should_commit = false)
|
60
|
-
pid_list.each { |pid| reindex_pid pid,
|
76
|
+
pid_list.each { |pid| reindex_pid pid, raise_errors: false } # use the default logger, don't let individual errors nuke the rest of the batch
|
61
77
|
ActiveFedora.solr.conn.commit if should_commit
|
62
78
|
end
|
63
79
|
end
|
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.
|
4
|
+
version: 5.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Klein
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2016-10-
|
17
|
+
date: 2016-10-13 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: active-fedora
|
@@ -82,14 +82,14 @@ dependencies:
|
|
82
82
|
name: json
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - "
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: 1.8.1
|
88
88
|
type: :runtime
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- - "
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: 1.8.1
|
95
95
|
- !ruby/object:Gem::Dependency
|
@@ -139,6 +139,9 @@ dependencies:
|
|
139
139
|
requirement: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - "~>"
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '1.1'
|
144
|
+
- - ">="
|
142
145
|
- !ruby/object:Gem::Version
|
143
146
|
version: 1.1.7
|
144
147
|
type: :runtime
|
@@ -146,22 +149,31 @@ dependencies:
|
|
146
149
|
version_requirements: !ruby/object:Gem::Requirement
|
147
150
|
requirements:
|
148
151
|
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: '1.1'
|
154
|
+
- - ">="
|
149
155
|
- !ruby/object:Gem::Version
|
150
156
|
version: 1.1.7
|
151
157
|
- !ruby/object:Gem::Dependency
|
152
158
|
name: rest-client
|
153
159
|
requirement: !ruby/object:Gem::Requirement
|
154
160
|
requirements:
|
155
|
-
- - "
|
161
|
+
- - ">="
|
156
162
|
- !ruby/object:Gem::Version
|
157
163
|
version: '1.7'
|
164
|
+
- - "<"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '3'
|
158
167
|
type: :runtime
|
159
168
|
prerelease: false
|
160
169
|
version_requirements: !ruby/object:Gem::Requirement
|
161
170
|
requirements:
|
162
|
-
- - "
|
171
|
+
- - ">="
|
163
172
|
- !ruby/object:Gem::Version
|
164
173
|
version: '1.7'
|
174
|
+
- - "<"
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
version: '3'
|
165
177
|
- !ruby/object:Gem::Dependency
|
166
178
|
name: rsolr-ext
|
167
179
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +221,9 @@ dependencies:
|
|
209
221
|
requirement: !ruby/object:Gem::Requirement
|
210
222
|
requirements:
|
211
223
|
- - "~>"
|
224
|
+
- !ruby/object:Gem::Version
|
225
|
+
version: '1.6'
|
226
|
+
- - ">="
|
212
227
|
- !ruby/object:Gem::Version
|
213
228
|
version: 1.6.5
|
214
229
|
type: :runtime
|
@@ -216,6 +231,9 @@ dependencies:
|
|
216
231
|
version_requirements: !ruby/object:Gem::Requirement
|
217
232
|
requirements:
|
218
233
|
- - "~>"
|
234
|
+
- !ruby/object:Gem::Version
|
235
|
+
version: '1.6'
|
236
|
+
- - ">="
|
219
237
|
- !ruby/object:Gem::Version
|
220
238
|
version: 1.6.5
|
221
239
|
- !ruby/object:Gem::Dependency
|
@@ -366,16 +384,22 @@ dependencies:
|
|
366
384
|
name: modsulator
|
367
385
|
requirement: !ruby/object:Gem::Requirement
|
368
386
|
requirements:
|
369
|
-
- - "
|
387
|
+
- - ">="
|
370
388
|
- !ruby/object:Gem::Version
|
371
389
|
version: 0.0.7
|
390
|
+
- - "<"
|
391
|
+
- !ruby/object:Gem::Version
|
392
|
+
version: '2'
|
372
393
|
type: :runtime
|
373
394
|
prerelease: false
|
374
395
|
version_requirements: !ruby/object:Gem::Requirement
|
375
396
|
requirements:
|
376
|
-
- - "
|
397
|
+
- - ">="
|
377
398
|
- !ruby/object:Gem::Version
|
378
399
|
version: 0.0.7
|
400
|
+
- - "<"
|
401
|
+
- !ruby/object:Gem::Version
|
402
|
+
version: '2'
|
379
403
|
- !ruby/object:Gem::Dependency
|
380
404
|
name: stanford-mods
|
381
405
|
requirement: !ruby/object:Gem::Requirement
|
@@ -452,14 +476,14 @@ dependencies:
|
|
452
476
|
requirements:
|
453
477
|
- - "~>"
|
454
478
|
- !ruby/object:Gem::Version
|
455
|
-
version: '10
|
479
|
+
version: '10'
|
456
480
|
type: :development
|
457
481
|
prerelease: false
|
458
482
|
version_requirements: !ruby/object:Gem::Requirement
|
459
483
|
requirements:
|
460
484
|
- - "~>"
|
461
485
|
- !ruby/object:Gem::Version
|
462
|
-
version: '10
|
486
|
+
version: '10'
|
463
487
|
- !ruby/object:Gem::Dependency
|
464
488
|
name: rspec
|
465
489
|
requirement: !ruby/object:Gem::Requirement
|
@@ -652,9 +676,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
652
676
|
version: 1.3.6
|
653
677
|
requirements: []
|
654
678
|
rubyforge_project:
|
655
|
-
rubygems_version: 2.
|
679
|
+
rubygems_version: 2.5.1
|
656
680
|
signing_key:
|
657
681
|
specification_version: 4
|
658
682
|
summary: Ruby implmentation of DOR services used by the SULAIR Digital Library
|
659
683
|
test_files: []
|
660
|
-
has_rdoc:
|