waistband 6.0.0 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/waistband.rb +9 -8
- data/lib/waistband/delete_by_query_result.rb +12 -0
- data/lib/waistband/index.rb +4 -0
- data/lib/waistband/version.rb +1 -1
- data/spec/lib/index/index_spec.rb +16 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d390f407bb9044bc047201802d63469d94d12b85
|
4
|
+
data.tar.gz: 2f2c0bd1e853334fbc616a0b9ffa2a9105c146ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1910ab48eb02d26b5990d41cd96c4bbe2450e41b4e630ba5276222aff5389977d650b3f1988cef3d13c98565fbbe81404dfbd74b286642ecaa73588d07fffd43
|
7
|
+
data.tar.gz: 68e0765716a8f88847bea76b601816486066969ffa2172d35cf0db63a93c3db22da8c7d7fe0594c0fe368a839bc63518df06da8d43b048c48b4f10a62aaba506
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [6.1.0] - 2019-05-10
|
8
|
+
### Added
|
9
|
+
- `#delete_by_query`
|
10
|
+
|
7
11
|
## [6.0.0] - 2019-02-04
|
8
12
|
### Added
|
9
13
|
- Support for Elasticsearch 6.x
|
data/lib/waistband.rb
CHANGED
@@ -2,14 +2,15 @@ require "waistband/version"
|
|
2
2
|
|
3
3
|
module Waistband
|
4
4
|
|
5
|
-
autoload :Errors,
|
6
|
-
autoload :StringifiedArray,
|
7
|
-
autoload :StringifiedHash,
|
8
|
-
autoload :Client,
|
9
|
-
autoload :Configuration,
|
10
|
-
autoload :Index,
|
11
|
-
autoload :SearchResults,
|
12
|
-
autoload :
|
5
|
+
autoload :Errors, "waistband/errors"
|
6
|
+
autoload :StringifiedArray, "waistband/stringified_array"
|
7
|
+
autoload :StringifiedHash, "waistband/stringified_hash"
|
8
|
+
autoload :Client, "waistband/client"
|
9
|
+
autoload :Configuration, "waistband/configuration"
|
10
|
+
autoload :Index, "waistband/index"
|
11
|
+
autoload :SearchResults, "waistband/search_results"
|
12
|
+
autoload :DeleteByQueryResult, "waistband/delete_by_query_result"
|
13
|
+
autoload :Result, "waistband/result"
|
13
14
|
|
14
15
|
class << self
|
15
16
|
|
data/lib/waistband/index.rb
CHANGED
@@ -207,6 +207,10 @@ module Waistband
|
|
207
207
|
::Waistband::SearchResults.new(search_hash, page: page, page_size: page_size)
|
208
208
|
end
|
209
209
|
|
210
|
+
def delete_by_query(query)
|
211
|
+
::Waistband::DeleteByQueryResult.new(client.delete_by_query(index: config_name, body: query))
|
212
|
+
end
|
213
|
+
|
210
214
|
def alias(alias_name)
|
211
215
|
alias_name = full_alias_name alias_name
|
212
216
|
client.indices.put_alias(
|
data/lib/waistband/version.rb
CHANGED
@@ -356,4 +356,20 @@ describe Waistband::Index do
|
|
356
356
|
|
357
357
|
end
|
358
358
|
|
359
|
+
describe '#delete_by_query' do
|
360
|
+
let(:delete_query) { { query: { match_all: {} } } }
|
361
|
+
let(:result) { index.delete_by_query(delete_query) }
|
362
|
+
|
363
|
+
before do
|
364
|
+
index.save('__test_write1', {'data' => 'index_1'})
|
365
|
+
index.save('__test_write2', {'data' => 'index_2'})
|
366
|
+
index.refresh
|
367
|
+
end
|
368
|
+
|
369
|
+
it "returns a DeleteByQueryResult object with expected properties" do
|
370
|
+
expect(result).to be_a Waistband::DeleteByQueryResult
|
371
|
+
expect(result.deleted).to eq(2)
|
372
|
+
expect(result.full_response).to be_a Hash
|
373
|
+
end
|
374
|
+
end
|
359
375
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waistband
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Jairala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/waistband.rb
|
102
102
|
- lib/waistband/client.rb
|
103
103
|
- lib/waistband/configuration.rb
|
104
|
+
- lib/waistband/delete_by_query_result.rb
|
104
105
|
- lib/waistband/errors.rb
|
105
106
|
- lib/waistband/index.rb
|
106
107
|
- lib/waistband/result.rb
|