spotlight-dor-resources 0.2.1 → 0.2.2
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: 41182091efc4f6afdff109e9138f81e47da10842
|
4
|
+
data.tar.gz: 5c7a966692a014d605cf86d254ff3ebd314f8ccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd2325ff88adfcaa2742de50dfc93acf3b9abceca2c7e51d313e9ed217ba124f61392195fb59bdc0821d3db2053a2d844bff4a24fc3cef9aecbb9aa2614c0a8
|
7
|
+
data.tar.gz: 5f30137f8f65572919015e4c9ccc9bc36f2d37b4e582eb7d061ea6d73b02a30a4a10687a7971adc2f437d94254b24c46bc9bf6f4e728c5f0a058c5309b5d3350
|
@@ -8,13 +8,13 @@ module Spotlight::Resources
|
|
8
8
|
#
|
9
9
|
# @return [Enumerator] an enumerator of solr document hashes for indexing
|
10
10
|
def to_solr
|
11
|
-
return to_enum(:to_solr) {
|
11
|
+
return to_enum(:to_solr) { size } unless block_given?
|
12
12
|
|
13
|
-
benchmark "Indexing resource #{inspect}" do
|
13
|
+
benchmark "Indexing resource #{inspect} (est. #{size} items)" do
|
14
14
|
base_doc = super
|
15
15
|
|
16
16
|
indexable_resources.each_with_index do |res, idx|
|
17
|
-
benchmark "Indexing item #{res.druid} in resource #{id} (#{idx})" do
|
17
|
+
benchmark "Indexing item #{res.druid} in resource #{id} (#{idx} / #{size})" do
|
18
18
|
yield base_doc.merge(to_solr_document(res))
|
19
19
|
end
|
20
20
|
end
|
@@ -42,6 +42,12 @@ module Spotlight::Resources
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
45
|
+
##
|
46
|
+
# Estimate the number of documents this resource will create
|
47
|
+
def size
|
48
|
+
indexable_resources.size
|
49
|
+
end
|
50
|
+
|
45
51
|
##
|
46
52
|
# Generate the solr document hash for a given resource by applying the current
|
47
53
|
# indexer steps.
|