chewy 0.8.0 → 0.8.1
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 +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +6 -0
- data/lib/chewy/index/actions.rb +10 -9
- data/lib/chewy/strategy.rb +1 -1
- data/lib/chewy/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a311bdd3957835909c81ba57886bba5fbebebbef
|
4
|
+
data.tar.gz: 0011b212e985166c040bb195ec3dc0214b797ab5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2727a488bbaefa2b0d9bd47da643a83e72882bfe3da41e4eda9e7e59df37fb72ad0343273594ae7dfbfbb8d4f84534d63867038b6fd8de667aca4eb0126c34a3
|
7
|
+
data.tar.gz: 6e54cfb1362cc06ff500ee01eb24c809c54c590b6390e20bfd45db4bb61c0c403ea3afd93b6dd3ef23bb53336efb157bd9c4cbca2aad9065db019a6693e84530
|
data/.travis.yml
CHANGED
@@ -37,6 +37,6 @@ matrix:
|
|
37
37
|
- rvm: 2.2.0
|
38
38
|
gemfile: gemfiles/rails.3.2.activerecord.will_paginate.gemfile
|
39
39
|
before_install:
|
40
|
-
- curl -# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.
|
40
|
+
- curl -# https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.2.tar.gz | tar xz -C /tmp
|
41
41
|
before_script:
|
42
|
-
- TEST_CLUSTER_COMMAND="/tmp/elasticsearch-1.5.
|
42
|
+
- TEST_CLUSTER_COMMAND="/tmp/elasticsearch-1.5.2/bin/elasticsearch" rake elasticsearch:start
|
data/CHANGELOG.md
CHANGED
data/lib/chewy/index/actions.rb
CHANGED
@@ -78,7 +78,11 @@ module Chewy
|
|
78
78
|
# UsersIndex.delete '01-2014' # deletes `users_01-2014` index
|
79
79
|
#
|
80
80
|
def delete suffix = nil
|
81
|
-
delete
|
81
|
+
result = client.indices.delete index: build_index_name(suffix: suffix)
|
82
|
+
Chewy.wait_for_status if result
|
83
|
+
result
|
84
|
+
# es-ruby >= 1.0.10 handles Elasticsearch::Transport::Transport::Errors::NotFound
|
85
|
+
# by itself, rescue is for previous versions
|
82
86
|
rescue Elasticsearch::Transport::Transport::Errors::NotFound
|
83
87
|
false
|
84
88
|
end
|
@@ -93,9 +97,9 @@ module Chewy
|
|
93
97
|
# UsersIndex.delete '01-2014' # deletes `users_01-2014` index
|
94
98
|
#
|
95
99
|
def delete! suffix = nil
|
96
|
-
|
97
|
-
|
98
|
-
|
100
|
+
# es-ruby >= 1.0.10 handles Elasticsearch::Transport::Transport::Errors::NotFound
|
101
|
+
# by itself, so it is raised here
|
102
|
+
delete(suffix) or raise Elasticsearch::Transport::Transport::Errors::NotFound
|
99
103
|
end
|
100
104
|
|
101
105
|
# Deletes and recreates index. Supports suffixes.
|
@@ -118,11 +122,8 @@ module Chewy
|
|
118
122
|
# UsersIndex.purge! '01-2014' # deletes `users` and `users_01-2014` indexes, creates `users_01-2014`
|
119
123
|
#
|
120
124
|
def purge! suffix = nil
|
121
|
-
|
122
|
-
|
123
|
-
delete! suffix
|
124
|
-
rescue Elasticsearch::Transport::Transport::Errors::NotFound
|
125
|
-
end
|
125
|
+
delete if suffix.present? && exists?
|
126
|
+
delete suffix
|
126
127
|
create! suffix
|
127
128
|
end
|
128
129
|
|
data/lib/chewy/strategy.rb
CHANGED
@@ -61,7 +61,7 @@ module Chewy
|
|
61
61
|
def debug string
|
62
62
|
if Chewy.logger && Chewy.logger.debug?
|
63
63
|
line = caller.detect { |line| line !~ %r{lib/chewy/strategy.rb:|lib/chewy.rb:} }
|
64
|
-
Chewy.logger.debug(["Chewy strategies stack: #{string}", line.sub(/:in\s.+$/, '')].join(' @ '))
|
64
|
+
Chewy.logger.debug(["DEBUG: Chewy strategies stack: #{string}", line.sub(/:in\s.+$/, '')].join(' @ '))
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/lib/chewy/version.rb
CHANGED