search_flip 2.0.0 → 2.1.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea5b70606b0678f78ee8f63d8ba580a9dd5b8dfc79d0b1d1ee347c6a8467a40e
4
- data.tar.gz: '027783a0a9097309f95df79a99f1dcedeadd7c40a007999d9c7918300fb737ee'
3
+ metadata.gz: 906fc0c71acae9c0ad7dd8b3089c78cbe73388348e43cd25470eb7289502652a
4
+ data.tar.gz: 5c45894fd491152c08cd3c5e39ca5bafa94e321ae81166dc7d3ce0012fa834ba
5
5
  SHA512:
6
- metadata.gz: 51792abe78d0b3863c26e7565c52a803180072db5ed3311336b9372619f978010835c789c71d340aee3070274d42fbeea8f3fc4d5c91c30486f43401e334782d
7
- data.tar.gz: 1a72bb276814d2d965fed28c4f992e1d79a05cb9fcd597eb9f465991300618521c62e897279b70edfa9e47ba6115039d4baf3d3c0906c0c471349293cb69ac06
6
+ metadata.gz: 2abdc760a6a104b242bd1147d4bf5629996c6e58b89b4a364b2b21c75daae0a3b57165577e75450b80fa965611b54a4680dd10deba7a22d3021381c7d893fa37
7
+ data.tar.gz: 81e2c3887da0f55653a60cbea327a068964b42acd30427b274f05e2091a5f30c67a7af0bbdac1ab38a29a31c97c4048a23c0ea265c5bb44c2b8a4ef7db8577d5
@@ -407,15 +407,15 @@ module SearchFlip
407
407
  # CommentIndex.range(lt: Time.parse("2014-01-01")).delete
408
408
  # CommentIndex.where(public: false).delete
409
409
 
410
- def delete
410
+ def delete(params = {})
411
411
  dupped_request = request.dup
412
412
  dupped_request.delete(:from)
413
413
  dupped_request.delete(:size)
414
414
 
415
415
  if connection.version.to_i >= 5
416
- connection.http_client.post("#{target.type_url}/_delete_by_query", params: request_params, json: dupped_request)
416
+ connection.http_client.post("#{target.type_url}/_delete_by_query", params: request_params.merge(params), json: dupped_request)
417
417
  else
418
- connection.http_client.delete("#{target.type_url}/_query", params: request_params, json: dupped_request)
418
+ connection.http_client.delete("#{target.type_url}/_query", params: request_params.merge(params), json: dupped_request)
419
419
  end
420
420
 
421
421
  target.refresh if SearchFlip::Config[:auto_refresh]
@@ -1,5 +1,5 @@
1
1
 
2
2
  module SearchFlip
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0.beta1"
4
4
  end
5
5
 
@@ -662,6 +662,14 @@ RSpec.describe SearchFlip::Criteria do
662
662
 
663
663
  expect { ProductIndex.where(id: [product1.id, product2.id]).delete }.to change { ProductIndex.total_count }.by(-2)
664
664
  end
665
+
666
+ it "accepts additional params" do
667
+ product = create(:product)
668
+
669
+ ProductIndex.import(product)
670
+
671
+ expect { ProductIndex.where(id: product.id).delete(conflicts: "proceed") }.to change { ProductIndex.total_count }.by(-1)
672
+ end
665
673
  end
666
674
 
667
675
  describe "#source" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: search_flip
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin Vetter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-02 00:00:00.000000000 Z
11
+ date: 2019-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -229,9 +229,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  requirements:
232
- - - ">="
232
+ - - ">"
233
233
  - !ruby/object:Gem::Version
234
- version: '0'
234
+ version: 1.3.1
235
235
  requirements: []
236
236
  rubyforge_project:
237
237
  rubygems_version: 2.7.3