cul_scv_hydra 0.21.7 → 0.21.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 684ab352172474db992c51f360fe139a1e2fa20b
|
4
|
+
data.tar.gz: 40d435f777c2192215ecbe9c5c176e9eae3a8b90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09d4bf1f2144d824113f83ec67e76ec429a9e79201d5d200a0e8d87cc9a92cfde0d8c507e1ab93fe3980a511ec828a8a0f529683d93da42de5d11bbee7bd2340
|
7
|
+
data.tar.gz: 964a5e44db39cf013413947d720e7a66beea2994f65a9cb21f85c3e1c48bdb37e704f74c1a4f109fb5e021113c66af8d03d81da644382b411796de0dcbf2138e
|
@@ -113,6 +113,16 @@ module Cul::Scv::Hydra::Models::Common
|
|
113
113
|
if (solr_doc["title_display_ssm"].length > 1)
|
114
114
|
solr_doc["title_display_ssm"].uniq!
|
115
115
|
end
|
116
|
+
|
117
|
+
if solr_doc["contributor_ssim"].present?
|
118
|
+
if solr_doc["contributor_ssim"].is_a?(Array)
|
119
|
+
solr_doc["contributor_first_si"] = solr_doc["contributor_ssim"].first
|
120
|
+
else
|
121
|
+
solr_doc["contributor_first_si"] = solr_doc["contributor_ssim"]
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
|
116
126
|
solr_doc["format_ssi"] = [self.route_as]
|
117
127
|
|
118
128
|
set_size_labels(solr_doc)
|
@@ -70,10 +70,10 @@ class GenericResource < ::ActiveFedora::Base
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
solr_doc["
|
73
|
+
solr_doc["fulltext_tesim"] = []
|
74
74
|
unless self.datastreams["fulltext"].nil?
|
75
|
-
solr_doc["
|
76
|
-
solr_doc["
|
75
|
+
solr_doc["fulltext_tesim"] << self.datastreams["fulltext"].content
|
76
|
+
solr_doc["fulltext_tesim"] << solr_doc["title_display_ssm"] unless solr_doc["title_display_ssm"].nil? or solr_doc["title_display_ssm"].length == 0
|
77
77
|
end
|
78
78
|
|
79
79
|
solr_doc
|
@@ -5,43 +5,51 @@ module Cul::Scv::Hydra::Indexer
|
|
5
5
|
raise 'Please supply a pid (e.g. rake recursively_index_fedora_objects pid=ldpd:123)'
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
raise 'Could not find Fedora object with pid: ' + pid
|
10
|
-
end
|
8
|
+
begin
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
puts 'Indexing topmost object in this set (' + pid + ')...' if verbose_output
|
16
|
-
puts 'If this is a BagAggregator with a lot of members, this may take a while...' if verbose_output
|
10
|
+
unless ActiveFedora::Base.exists?(pid)
|
11
|
+
raise 'Could not find Fedora object with pid: ' + pid
|
12
|
+
end
|
17
13
|
|
18
|
-
|
14
|
+
if pids_to_omit.present? && pids_to_omit.include?(pid)
|
15
|
+
puts 'Skipping topmost object in this set (' + pid + ') because it has been intentionally omitted...' if verbose_output
|
16
|
+
else
|
17
|
+
puts 'Indexing topmost object in this set (' + pid + ')...' if verbose_output
|
18
|
+
puts 'If this is a BagAggregator with a lot of members, this may take a while...' if verbose_output
|
19
19
|
|
20
|
-
|
20
|
+
yield pid
|
21
21
|
|
22
|
-
|
22
|
+
end
|
23
23
|
|
24
|
-
|
24
|
+
puts 'Recursively retreieving and indexing all members of ' + pid + '...'
|
25
25
|
|
26
|
-
|
27
|
-
puts 'Recursive search found ' + total_number_of_members.to_s + ' members.' if verbose_output
|
26
|
+
unique_pids = Cul::Scv::Hydra::RisearchMembers.get_recursive_member_pids(pid, true)
|
28
27
|
|
29
|
-
if pids_to_omit.present?
|
30
|
-
unique_pids = unique_pids - pids_to_omit
|
31
28
|
total_number_of_members = unique_pids.length
|
32
|
-
puts '
|
33
|
-
end
|
29
|
+
puts 'Recursive search found ' + total_number_of_members.to_s + ' members.' if verbose_output
|
34
30
|
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
if pids_to_omit.present?
|
32
|
+
unique_pids = unique_pids - pids_to_omit
|
33
|
+
total_number_of_members = unique_pids.length
|
34
|
+
puts 'After checking against the list of omitted pids, the total number of objects to index will be: ' + total_number_of_members.to_s if verbose_output
|
35
|
+
end
|
38
36
|
|
39
|
-
|
37
|
+
i = 1
|
38
|
+
if total_number_of_members > 0
|
39
|
+
unique_pids.each {|pid|
|
40
40
|
|
41
|
-
|
41
|
+
puts 'Recursing on ' + i.to_s + ' of ' + total_number_of_members.to_s + ' members (' + pid + ')...' if verbose_output
|
42
|
+
|
43
|
+
yield pid
|
44
|
+
|
45
|
+
i += 1
|
46
|
+
}
|
47
|
+
end
|
42
48
|
|
43
|
-
|
44
|
-
}
|
49
|
+
rescue RestClient::Unauthorized => e
|
50
|
+
error_message = "Skipping #{pid} due to error: " + e.message + '. Problem with Fedora object?'
|
51
|
+
puts error_message
|
52
|
+
logger.error error_message if defined?(logger)
|
45
53
|
end
|
46
54
|
|
47
55
|
puts 'Recursion complete!'
|