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: b9c7b421a13eda5a5700db8c0bf1901f5f5838a3
4
- data.tar.gz: 05e7e9e1f72e767085fb48df489843281bebfa1d
3
+ metadata.gz: 41182091efc4f6afdff109e9138f81e47da10842
4
+ data.tar.gz: 5c7a966692a014d605cf86d254ff3ebd314f8ccd
5
5
  SHA512:
6
- metadata.gz: 84d0129c9e2a56a2f2962d659a63a6f1a861b771e32a4901704f1be5307dd57fffa57dab5595e71563fde33454b87d708af789e29f1ce90b91f251b28d2d8fe4
7
- data.tar.gz: 445c27164425683a629d5fb7eea1aeb0327462bab585cdec08506060782486119d66e2e5ac02353c092d963653ed996f0b942cb7e66ea57b4380f16f7546c742
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) { indexable_resources.size } unless block_given?
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.
@@ -2,7 +2,7 @@ module Spotlight
2
2
  module Dor
3
3
  # :nodoc:
4
4
  module Resources
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spotlight-dor-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer