datastax_rails 2.4.4 → 2.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/solrconfig.xml.erb +1 -1
- data/lib/datastax_rails/schema/solr.rb +14 -5
- data/lib/datastax_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b84e6f90074a208e23849f44c8cd68d51f9413b8
|
4
|
+
data.tar.gz: a9fa06f32534a9a1141ee15376d3bc9ae3808bff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18ae118015df25c7cdcab36051e92ea1f50a8f18262d1ff87629889683dec60db3ffebc6a2fdf7660867cd67a46f69339223faed1a7c3475b21077664a276115
|
7
|
+
data.tar.gz: b78febe8c0df4d46e758007387114b96d396afcd1af838be2d3e35f3d6ee0cc9b621eed47ad196519d6a8e97f0a181b19eb3147d4e85b59d2f3b8311a7afa4ac
|
data/config/solrconfig.xml.erb
CHANGED
@@ -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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
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')
|
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
|
+
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:
|
11
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|