active-fedora 6.6.0.pre4 → 6.6.0.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4995b4f2b4c10a25a2a6ed613fb2f6cadd5cbc1d
4
- data.tar.gz: 3751da9a77221454120ac555b1704502ad95d2fc
3
+ metadata.gz: 964d99013806f9b52b6b916d277df38d6dbea927
4
+ data.tar.gz: 10f8ff33c035ecccb052c23d2c77166f8f605240
5
5
  SHA512:
6
- metadata.gz: d74b8c98fbec12782819cae635a80d93d6ac2ea4578899bcefc4371e79c70d7f30bfa8a8026f36facfc4f2b03ae7b9ecd1ba51c4cded3302bad478da478d1c61
7
- data.tar.gz: a752d40a3e2110c729c43657bd8e205c1b88ba342a098d0ee310dc1ef8ad1dc551fe35396809c228711d91008d5217f34f09a9289f5c27a9071c08cb839279f0
6
+ metadata.gz: 07707c2080d608e9ed4a3ecadf8e88f64ff4a0867bc8b79f1a63d92383d21152fc67b16c8db191d8987697fd516d99aed3b8d7c8d205ea1caeb6cf017d0bea8e
7
+ data.tar.gz: aae37c986f98847630f0f9e98d3f8a52fee97a7cc2ab725983478d1d1b3e0e05630e8507528c7986fdfbde7ad84a2f44feffb0b6c5b8cb8d17194886598fcf69
@@ -7,10 +7,15 @@ module ActiveFedora
7
7
  end
8
8
 
9
9
  def find_target
10
+ page_size = @reflection.options[:solr_page_size]
11
+ page_size ||= 200
10
12
  pids = @owner.ids_for_outbound(@reflection.options[:property])
11
13
  return [] if pids.empty?
12
- query = ActiveFedora::SolrService.construct_query_for_pids(pids)
13
- solr_result = SolrService.query(query, rows: 1000)
14
+ solr_result = []
15
+ 0.step(pids.size,page_size) do |startIdx|
16
+ query = ActiveFedora::SolrService.construct_query_for_pids(pids.slice(startIdx,page_size))
17
+ solr_result += ActiveFedora::SolrService.query(query, rows: page_size)
18
+ end
14
19
  return ActiveFedora::SolrService.reify_solr_results(solr_result)
15
20
  end
16
21
 
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "6.6.0.pre4"
2
+ VERSION = "6.6.0.rc1"
3
3
  end
@@ -28,5 +28,20 @@ describe ActiveFedora::Associations::HasAndBelongsToManyAssociation do
28
28
  ac << object
29
29
 
30
30
  end
31
-
31
+
32
+ it "should call solr query multiple times" do
33
+
34
+ subject = double("subject", :new_record? => false, :pid => 'subject:a', :internal_uri => 'info:fedora/subject:a', :ids_for_outbound => [])
35
+ predicate = double(:klass => double.class, :options=>{:property=>'predicate', solr_page_size:10}, :class_name=> nil)
36
+ ids = []
37
+ 0.upto(15) {|i| ids << i.to_s}
38
+ query1 = ids.slice(0,10).map {|i| "_query_:\"{!raw f=id}#{i}\""}.join(" OR ")
39
+ query2 = ids.slice(10,10).map {|i| "_query_:\"{!raw f=id}#{i}\""}.join(" OR ")
40
+ subject.should_receive(:ids_for_outbound).and_return(ids)
41
+ ActiveFedora::SolrService.should_receive(:query).with(query1, {:rows=>10}).and_return([])
42
+ ActiveFedora::SolrService.should_receive(:query).with(query2, {:rows=>10}).and_return([])
43
+
44
+ ac = ActiveFedora::Associations::HasAndBelongsToManyAssociation.new(subject, predicate)
45
+ ac.find_target
46
+ end
32
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.0.pre4
4
+ version: 6.6.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Zumwalt
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-09-28 00:00:00.000000000 Z
13
+ date: 2013-09-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr