datastax_rails 2.4.4 → 2.4.8

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: c995883ead403d6ca3e7fb247feaec562361cd40
4
- data.tar.gz: d81eaeeee8b20156ff6e752c8ce7da6037ffad4a
3
+ metadata.gz: b84e6f90074a208e23849f44c8cd68d51f9413b8
4
+ data.tar.gz: a9fa06f32534a9a1141ee15376d3bc9ae3808bff
5
5
  SHA512:
6
- metadata.gz: c87e71d2898ac4d3e73d9676083ef48d48ee936dfaf3ffb343e551b3298568884a5444e09530b2e411704daa23dce1c949b830a15e147da0ec33535e1a9628d3
7
- data.tar.gz: ad90941b3f68b77c2ce2ae0746b1effdf2f2f7e0590288ab5fc9ac99026214dc56695e4275db6a82103ab3c8d17b1bb20e732c8e548bef8dcf8f0cf293d1b22c
6
+ metadata.gz: 18ae118015df25c7cdcab36051e92ea1f50a8f18262d1ff87629889683dec60db3ffebc6a2fdf7660867cd67a46f69339223faed1a7c3475b21077664a276115
7
+ data.tar.gz: b78febe8c0df4d46e758007387114b96d396afcd1af838be2d3e35f3d6ee0cc9b621eed47ad196519d6a8e97f0a181b19eb3147d4e85b59d2f3b8311a7afa4ac
@@ -335,11 +335,11 @@
335
335
  the cache. (see java.util.HashMap)
336
336
  autowarmCount - the number of entries to prepopulate from
337
337
  and old cache.
338
- -->
339
338
  <filterCache class="solr.FastLRUCache"
340
339
  size="128"
341
340
  initialSize="0"
342
341
  autowarmCount="0"/>
342
+ -->
343
343
 
344
344
  <!-- Query Result Cache
345
345
 
@@ -39,10 +39,18 @@ module DatastaxRails
39
39
  # Sends a command to Solr instructing it to reindex the data. The data is reindexed in the background,
40
40
  # and the new index is swapped in once it is finished.
41
41
  def reindex_solr(model, destructive = false)
42
- url = "#{DatastaxRails::Base.solr_base_url}/admin/cores?action=RELOAD&name=#{DatastaxRails::Base.config[:keyspace]}.#{model.column_family}&reindex=true&deleteAll=#{destructive}"
43
- say "Posting reindex command to '#{url}'", :subitem
44
- `curl -s -X POST '#{url}' -H 'Content-type:text/xml; charset=utf-8'`
45
- say 'Reindexing will run in the background', :subitem
42
+ reload_solr_core(model, true, destructive)
43
+ end
44
+
45
+ # Sends a command to Solr instructing it to reload the core for a given model.
46
+ # This is for making sure that solr knows the model changes when it comes to multiple
47
+ # datacenter deployments.
48
+ def reload_solr_core(model, reindex = false, destructive = false)
49
+ url = "#{DatastaxRails::Base.solr_base_url}/admin/cores?action=RELOAD&name=#{DatastaxRails::Base.config[:keyspace]}.#{model.column_family}&reindex=#{reindex}&deleteAll=#{destructive}"
50
+ action = reindex ? 'reindex' : 'reload'
51
+ say "Posting #{action} command to '#{url}'", :subitem
52
+ system("curl -s -X POST '#{url}' -H 'Content-type:text/xml; charset=utf-8' &")
53
+ say "#{action.capitalize} will run in the background", :subitem
46
54
  end
47
55
 
48
56
  # Creates the initial Solr Core. This is required once the first time a Solr schema is uploaded.
@@ -50,7 +58,7 @@ module DatastaxRails
50
58
  def create_solr_core(model)
51
59
  url = "#{DatastaxRails::Base.solr_base_url}/admin/cores?action=CREATE&name=#{DatastaxRails::Base.config[:keyspace]}.#{model.column_family}"
52
60
  say "Posting create command to '#{url}'", :subitem
53
- `curl -s -X POST '#{url}' -H 'Content-type:text/xml; charset=utf-8'`
61
+ system("curl -s -X POST '#{url}' -H 'Content-type:text/xml; charset=utf-8' &"
54
62
  end
55
63
 
56
64
  # Uploads the necessary configuration files for solr to function
@@ -61,6 +69,7 @@ module DatastaxRails
61
69
  # TODO: find a way to upload arbitrary files automatically (e.g., additional stopwords lists)
62
70
  # TODO: Simplify this method
63
71
  def upload_solr_configuration(model, force = false, reindex = true) # rubocop:disable all
72
+ reload_solr_core(model, false, false)
64
73
  count = 0
65
74
  @live_indexing = model.live_indexing
66
75
  @solr_commit_time = model.solr_commit_time || (@live_indexing ? '1000' : '5000')
@@ -1,4 +1,4 @@
1
1
  # rubocop:disable Style/Documentation
2
2
  module DatastaxRails
3
- VERSION = '2.4.4'
3
+ VERSION = '2.4.8'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datastax_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason M. Kusar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-12 00:00:00.000000000 Z
11
+ date: 2016-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails